Real-time or near real-time streaming

ABSTRACT

A user interface (UI) for controlling buffered content of a streaming presentation is disclosed. In one embodiment, the UI includes a time line which represents a length in time of a streaming content that has been buffered at a receiver, such as a client device which retrieves the streaming content by sending one or more URLs, in a playlist file, to a transmitter; an indicator on the time line shows a current playback position within the buffered content at the receiver.

RELATED APPLICATIONS

This application claims the benefit of the filing date of U.S.provisional application 61/378,893 filed on Aug. 31, 2010, and thisapplication hereby incorporates by reference herein that provisionalapplication. This application is also related to the following patentapplications:

(1) Application No. 61/142,110 filed on Dec. 31, 2008;

(2) Application No. 61/160,693 filed on Mar. 16, 2009;

(3) Application No. 61/161,036 filed on Mar. 17, 2009;

(4) Application No. 61/167,524 filed on Apr. 7, 2009;

(5) Application No. 61/240,648 filed on Sep. 8, 2009;

(6) Application No. 61/288,828 filed on Dec. 21, 2009;

(7) Application No. 61/320,213 filed on Apr. 1, 2010;

(8) Application No. 61/321,767 filed on Apr. 7, 2010; and

(9) Application No. 61/351,824 filed on Jun. 4, 2010. All of these U.S.provisional applications are incorporated herein by reference to theextent that they are consistent with this disclosure.

The present U.S. Patent application is related to the following U.S.Patent applications, each of which is incorporated herein by referenceto the extent they are consistent with this disclosure:

-   -   (1) Application Ser. No. 12/479,690, filed Jun. 5, 2009,        entitled “REAL-TIME OR NEAR REAL-TIME STREAMING;”    -   (2) Application Ser. No. 12/479,698, filed Jun. 5, 2009,        entitled “VARIANT STREAMS FOR REAL-TIME OR NEAR REAL-TIME        STREAMING;”    -   (3) Application Ser. No. 12/479,732, filed Jun. 5, 2009,        entitled “UPDATABLE REAL-TIME OR NEAR REAL-TIME STREAMING;”    -   (4) Application Ser. No. 12/479,735, filed Jun. 5, 2009,        entitled “PLAYLISTS FOR REAL-TIME OR NEAR REAL-TIME STREAMING;”    -   (5) Application Ser. No. 12/878,002, filed Sep. 8, 2010,        entitled “VARIANT STREAMS FOR REAL-TIME OR NEAR REAL-TIME        STREAMING TO PROVIDE FAILOVER PROTECTION;” and    -   (6) Application Ser. No. 12/968,202, filed Dec. 14, 2010        entitled “REAL-TIME OR NEAR REAL-TIME STREAMING WITH COMPRESSED        PLAYLISTS.”

TECHNICAL FIELD

Embodiments of the invention relate to data transmission techniques.More particularly, embodiments of the invention relate to techniquesthat allow streaming of data using non-streaming protocols such as, forexample, HyperText Transfer Protocol (HTTP).

BACKGROUND

Streaming of content generally refers to multimedia content that isconstantly transmitted from a server device and received by a clientdevice. The content is usually presented to an end-user while it isbeing delivered by the streaming server. The name refers to the deliverymethod of the medium rather than to the medium itself

Current streaming services generally require specialized servers todistribute “live” content to end users. In any large scale deployment,this can lead to great cost, and requires specialized skills to set upand run. This results in a less than desirable library of contentavailable for streaming.

SUMMARY OF THE DESCRIPTION

In one embodiment described herein, playlists containing or specifyingmultiple media files can be created to ensure a certain minimum durationin time while allowing the multiple media files specified within theplaylist to be shorter and perhaps even considerably shorter than theminimum duration of a playlist. For example, in one implementation ofthis embodiment, a method can set a target duration of a media filespecified in a playlist as a maximum duration for each media filespecified within the playlist and can then set or determine a minimumplaylist duration as a multiple of the target duration. This can allow,in one implementation, the duration of each media file to be relativelyshort, such as a few seconds, while also ensuring that there issufficient buffering occurring at a client device because the cumulativeduration of the media files within the playlist satisfy a minimum, whichcan be based upon a multiple of a minimum or a maximum duration of eachmedia file. A method according to this embodiment can also require aserver to use a server timing model to transmit no earlier than anearliest time and no later than a latest time, wherein the earliest timeand the latest time are based upon a time when an immediately previousplaylist was first made available for transmission from a server. Forexample, in one embodiment the earliest time can be set as a time noearlier than one-half (or other multiple) of a target duration from whenthe previous playlist file was first made available for transmission,and the latest time can be set such that the server will transmit a newplaylist file no later than one and a half times (or other multiple of)the target duration from when the immediately previous playlist file wasfirst made available for transmission. The use of such earliest andlatest times by a server, which is transmitting playlists, can allow aclient device to implement an algorithm that reduces the amount ofpolling, by the client device, to discover playlist changes.

In another embodiment, a client device can adaptively determine anamount of overlap in time between two streams, such as two streams fromtwo different playlists. For example, a client device can modify aminimum amount of overlap between the two streams based upon aconnection speed or the type of connection. For example, a client devicecan request a first set of media files specified in a first playlist andcan also request a second set of media files specified in the firstplaylist or another playlist, and the client device can store thecontent from both media files while presenting the content from thefirst set. The storage of both sets can create an overlap in time, suchas the overlap shown in FIG. 9D and described below. The client devicecan set a minimum amount of overlap, which is required before switching,based upon the connection speed or connection type. For example, ahigher connection speed, such as a 3G wireless cellular telephoneconnection (which is faster than a 2G wireless cellular telephoneconnection), may permit a smaller minimum overlap to be used while aslower connection speed may require a larger minimum overlap to be used.The client device can modify the minimum overlap based upon theconnection speed or connection type and thereby adapt to the environmentin which the client device is operating. After the client deviceestablishes that a minimum amount of overlap exists, the client devicecan switch from one stream to the other stream as described furtherherein.

In yet another embodiment, a method described further herein can enforcea rule at a client device that requires playback to be started from astart point in a playlist file that is set to be at least a period oftime before an end of the playlist file. For example, in oneimplementation, a start point for playback can be required to be atleast several (e.g. three or five, etc.) target durations before the endof a playlist file. This can be desirable in order to prevent the clientdevice from stalling during playback because no content is available tobe displayed. This can be particularly advantageous when a client deviceis allowed to start playback at just before the last moments of a livestreaming event; in this case, a client device may be viewing orotherwise presenting the last 10 or 20 seconds of a live event, and if adelay in the network or other distribution channel occurs, then theclient device can run out of content to present. This problem can bereduced by enforcing the rule described herein which requires theplayback point to begin from at least a certain period of time beforethe end of the playlist file. That period of time can be adjusted basedupon expected network latency or other delays in order to attempt toavoid a stall in playback caused by a sudden lack of content that can bepresented.

In one embodiment, a system can search for content based upon a date andtime. For example, in one implementation, timestamped tags are created,and each of the timestamped tags can be associated with a particularmedia file. The timestamp in a timestamped tag indicates a beginningdate and time of the associated media file. Note that the media file maycontain its own internal timestamps. A playlist file can be created withone or more timestamped tags. The playlist file can be distributed andmade available for searching by date and time using the date and time inthe timestamped tags.

In one embodiment, a method can execute a user application on a clientdevice to present media files and to control presentation of the mediafiles. The method can further run a media serving process on the clientdevice to retrieve a playlist specifying the media files and a mediasource at which the media files are available, to retrieve the mediafiles from the media source, and to decode the media files retrieved.While the media serving process is separate from the user application,they may share the same privileges with respect to memory control,memory space, memory allocation, filesystem control, and networkcontrol.

Some embodiments include one or more application programming interfaces(APIs) in an environment with calling program code interacting withother program code being called through the one or more interfaces.Various function calls, messages or other types of invocations, whichfurther may include various kinds of parameters, can be transferred viathe APIs between the calling program and the code being called. Inaddition, an API may provide the calling program code the ability to usedata types or classes defined in the API and implemented in the calledprogram code.

At least certain embodiments include an environment with a callingsoftware component interacting with a called software component throughan API. A method for operating through an API in this environmentincludes transferring one or more function calls, messages, other typesof invocations or parameters via the API.

Other methods are described herein and systems for performing thesemethods are described herein and machine readable, non-transitorystorage media storing executable instructions which when executed cancause a data processing system to perform any one of these methods arealso described herein.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention is illustrated by way of example, and not by way oflimitation, in the figures of the accompanying drawings in which likereference numerals refer to similar elements.

FIG. 1 is a block diagram of one embodiment of a server and clients thatcan send and receive real-time, or near real-time, content.

FIG. 2A is a flow diagram of one embodiment of a technique for one ormore server devices to support media content using non-streamingprotocols.

FIG. 2B is a flow diagram of one embodiment of a technique for one ormore server devices to provide dynamically updated playlists to one ormore client devices.

FIG. 2C is a flow diagram of one embodiment of a technique for one ormore server devices to provide media content to client devices usingmultiple bit rates.

FIG. 3A is a flow diagram of one embodiment of a technique for a clientdevice to support streaming of content using non-streaming protocols.

FIG. 3B is a flow diagram of one embodiment of a technique for a clientdevice to support streaming of content using multiple bit rates.

FIG. 4 is a block diagram of one embodiment of a server stream agent.

FIG. 5 is a block diagram of one embodiment of a client stream agent.

FIG. 6 illustrates on embodiment, of a playlist file with multiple tags.

FIG. 7 is a flow diagram of one embodiment of a playback technique forassembled streams as described herein.

FIG. 8 is a block diagram of one embodiment of an electronic system.

FIG. 9A is a flowchart showing an example of how a client device canswitch between alternative content in a variant playlist.

FIG. 9B is a further flowchart showing how a client device can switchbetween content in two playlists.

FIG. 9C is a further flowchart showing an example of how a client devicecan switch between content using audio pattern matching.

FIG. 9D shows diagrammatically how the method of FIG. 9C is implementedwith audio pattern matching.

FIG. 10 is a flow diagram of one embodiment of a technique for providingmultiple redundant locations that provide media content to clientdevices using alternative streams.

FIG. 11 illustrates a network in which a client 1102 communicatesbi-directionally with one or more URLs in accordance with oneembodiment.

FIG. 12A is a flowchart depicting a method according to one embodimentof the present invention for controlling the creation and distributionof playlists.

FIG. 12B shows a timeline of how, in one embodiment, playlists can betransmitted or otherwise distributed using, for example, a method as inFIG. 12A.

FIG. 13 is a method, according to one embodiment of the invention, forcontrolling playback at a client device.

FIG. 14A shows a flowchart depicting a method, in one embodiment, foradaptively determining an amount of minimum overlap based uponconnection speed or connection type. FIGS. 14B, 14C, and 14D showanother aspect of an embodiment which uses an overlap for switchingbetween streams.

FIG. 15 is a flowchart depicting another method according to oneembodiment of the present invention.

FIG. 16A shows a flowchart that depicts a method according to oneembodiment for using the timestamped tags to create a playlist file.

FIG. 16B shows a flowchart that depicts a method according to oneembodiment for using the timestamped tags in a playlist file to searchfor media files.

FIG. 16C shows an embodiment of a user interface for controllingplayback from buffered streaming content at a receiver.

FIG. 16D shows the embodiment of FIG. 16C after an indicator on the timeline of the UI has been moved.

FIG. 16E is a flowchart showing a method for using the embodiment of theuser interface shown in FIGS. 16C and 16D.

FIG. 17 shows an example of software architecture to allow a mediaserving daemon to interact with a user application.

FIG. 18 illustrates a block diagram of an exemplary API architectureusable in some embodiments of the invention.

FIG. 19 shows an exemplary embodiment of a software stack usable in someembodiments of the invention.

DETAILED DESCRIPTION

In the following description, numerous specific details are set forth.However, embodiments of the invention may be practiced without thesespecific details. In other instances, well-known circuits, structuresand techniques have not been shown in detail in order not to obscure theunderstanding of this description.

The present description includes material protected by copyrights, suchas illustrations of graphical user interface images. The owners of thecopyrights, including the assignee of the present invention, herebyreserve their rights, including copyright, in these materials. Thecopyright owner has no objection to the facsimile reproduction by anyoneof the patent document or the patent disclosure, as it appears in thePatent and Trademark Office file or records, but otherwise reserves allcopyrights whatsoever. Copyright Apple Inc. 2009.

In one embodiment, techniques and components described herein caninclude mechanisms to deliver streaming experience using non-streamingprotocols (e.g., HTTP) and other technologies (e.g., Motion PictureExpert Group (MPEG) streams). For example, near real-time streamingexperience can be provided using HTTP to broadcast a “live” musical orsporting event, live news, a Web camera feed, etc. In one embodiment, aprotocol can segment incoming media data into multiple media files andstore those segmented media files on a server. The protocol can alsobuild a playlist file that includes Uniform Resource Identifiers (URIs)that direct the client to the segmented media files stored on a server.When the segmented media files are played back in accordance with theplaylist file(s), the client can provide the user with a near real-timebroadcast of a “live” event. Pre-recorded content can be provided in asimilar manner.

In one embodiment, the server can dynamically introduce supplementary oralternative media content (e.g., advertisements, statistics related to asporting event, additional media content to the main presentation) intothe broadcast event. For example, during client playback of a mediaevent, the server can add additional URIs to the playlist file, the URIsmay identify a location from which a client can download a supplementarymedia file. The client can be instructed to periodically retrieve fromthe server one or more updated playlist file(s) in order to access anysupplementary or additional (or both) media content the server hasintroduced.

In one embodiment, the server can operate in either cumulative mode orin rolling mode. In cumulative mode, the server can create a playlistfile and append media file identifiers to the end of the playlist file.The client then has access to all parts of the stream from a singleplaylist file (e.g., a user can start at the middle of a show) whendownloaded. In rolling mode, the server may limit the availability ofmedia files by removing media file identifiers from the beginning of theplaylist file on a rolling basis, thereby providing a sliding window ofmedia content accessible to a client device. The server can also addmedia file identifiers to the playlist and, in rolling mode, the servercan limit the availability of media files to those that have been mostrecently added to the playlist. The client then repeatedly downloadsupdated copies of the playlist file to continue viewing. The rollingbasis for playlist downloading can be useful when the content ispotentially unbounded in time (e.g. content from a continuously operatedweb cam). The client can continue to repeatedly request the playlist inthe rolling mode until it finds an end tag in the playlist.

In one embodiment, the mechanism supports bit rate switching byproviding variant streams of the same presentation. For example, severalversions of a presentation to be served can be stored on the server.Each version can have substantially the same content but be encoded atdifferent bit rates. This can allow the client device to switch betweenbit rates depending on, for example, a detection of the availablebandwidth, without compromising continuity of playback.

In one embodiment, protection features may be provided to protectcontent against unauthorized use. For example, non-sequential media filenumbering may be used to prevent prediction. Encryption of media filesmay be used. Partial media file lists may be used. Additional and/ordifferent protection features may also be provided.

FIG. 1 is a block diagram of one embodiment of a server and clients thatcan send and receive real-time, or near real-time, content. The exampleof FIG. 1 provides a simple server-client connection with two clientscoupled with a server via a network. Any number of clients may besupported utilizing the techniques and mechanisms described herein.Further, multiple servers may provide content and/or may operatetogether to provide content according to the techniques and mechanismsdescribed herein. For example, one server may create the content, createthe playlists and create the multiple media (e.g. files) and otherservers store and transmit the created content.

Network 110 may be any type of network whether wired, wireless (e.g.,IEEE 802.11, 802.16) or any combination thereof. For example, Network100 may be the Internet or an intranet. As another example, network 110may be a cellular network (e.g., 3G, CDMA). In one embodiment, clientdevices 150 and 180 may be capable of communicating over multiplenetwork types (e.g. each device can communicate over a WiFi wireless LANand also over a wireless cellular telephone network). For example,client devices 150 and 180 may be smart phones or cellular-enabledpersonal digital assistants that can communicate over cellularradiotelephone networks as well as data networks. These devices may beable to utilize the streaming mechanisms described herein over eithertype of network or even switch between networks as necessary.

Server 120 may operate as a HTTP server in any manner known in the art.That is server 120 includes a HTTP server agent 145 that providescontent using HTTP protocols. While the example of FIG. 1 is describedin terms of HTTP, other protocols can be utilized in a similar manner.Segmenter 130 and indexer 135 are agents that reside on server 120 (ormultiple servers) to provide content in media files with a playlist fileas described herein. These media files and playlist files may beprovided over network 110 via HTTP server agent 145 (or via otherservers) using HTTP protocols. Agents as discussed herein can beimplemented as hardware, software, firmware or a combination thereof.

Segmenter 130 may function to divide the stream of media data intomultiple media files that may be transmitted via HTTP protocols. Indexer135 may function to create a playlist file corresponding to thesegmented media files so that client devices can reassemble the mediafiles to provide real-time, or near real-time, transmission of thecontent provided by server 120. In response to one or more requests froma client device, HTTP server agent 145 (or other servers) may transmitone or more playlist files as generated by indexer 135 and media filesof content as generated by segmenter 130. Server 120 may further includeoptional security agent 140 that provides one or more of the securityfunctions (e.g. encryption) discussed herein. Server 120 may alsoinclude additional components not illustrated in FIG. 1.

Client devices 150 and 180 may receive the playlist files and mediafiles from server 120 over network 110. Client devices may be any typeof electronic device that is capable of receiving data transmitted overa network and generate output utilizing the data received via thenetwork, for example, wireless mobile devices, PDAs, entertainmentdevices, consumer electronic devices, etc. The output may be any mediatype of combination of media types, including, for example, audio, videoor any combination thereof

Client device 150 can include assembler agent 160 and output generatoragent 165. Similarly, client device 180 can include assembler agent 190and output generator agent 195. Assembler agents 160 and 180 receive theplaylist files from server 120 and use the playlist files to access anddownload media files from server 120. Output generator agents 165 and195 use the downloaded media files to generate output from clientdevices 150 and 160, respectively. The output may be provided by one ormore speakers, one or more display screens, a combination of speakersand display screens or any other input or output device. The clientdevices can also include memory (e.g. flash memory or DRAM, etc.) to actas a buffer to store the media files (e.g. compressed media files ordecompressed media files) as they are received; the buffer can providemany seconds worth of presentable content beyond the time of contentcurrently being presented so that the buffered content can later bedisplayed while new content is being downloaded. This buffer can providepresentable content while the client device is attempting to retrievecontent through an intermittently slow network connection and hence thebuffer can hide network latency or connection problems.

Client devices 150 and 180 may further include optional security agents170 and 185, respectively that provide one or more of the securityfunctions discussed herein. Client devices 150 and 180 may also includeadditional components not illustrated in FIG. 1.

In one embodiment, the techniques that are described in this applicationmay be used to transmit an unbounded stream of multimedia data over anon-streaming protocol (e.g., HTTP). Embodiments can also includeencryption of media data and/or provision of alternate versions of astream (e.g., to provide alternate bit rates). Because media data can betransmitted soon after creation, the data can be received in nearreal-time. Example data formats for files as well as actions to be takenby a server (sender) and a client (receiver) of the stream of multimediadata are provided; however, other formats can also be supported.

A media presentation that can be transmitted as a simulated real-timestream (or near real-time stream) is specified by a Universal ResourceIndicator (URI) that indicates a playlist file. In one embodiment, theplaylist file is an ordered list of additional URIs. Each URI in theplaylist file refers to a media file that is a segment of a stream,which may be a single contiguous stream of media data for a particularprogram.

In order to play the stream of media data, the client device obtains theplaylist file from the server. The client also obtains and plays eachmedia data file indicated by the playlist file. In one embodiment, theclient can dynamically or repeatedly reload the playlist file todiscover additional and/or different media segments.

The playlist files may be, for example, Extended M3U Playlist files. Inone embodiment, additional tags that effectively extend the M3U formatare used. M3U refers to Moving Picture Experts Group Audio Layer 3Uniform Resource Locator (MP3 URL) and is a format used to storemultimedia playlists. A M3U file is a text file that contains thelocations of one or more media files for a media player to play.

The playlist file, in one embodiment, is an Extended M3U-formatted textfile that consists of individual lines. The lines can be terminated byeither a single LF character or a CR character followed by a LFcharacter. Each line can be a URI, a blank line, or start with a commentcharacter (e.g. ‘#’). URIs identify media files to be played. Blanklines can be ignored.

Lines that start with the comment character can be either comments ortags. Tags can begin with #EXT, while comment lines can begin with #.Comment lines are normally ignored by the server and client. In oneembodiment, playlist files are encoded in UTF-8 format. UTF-8 (8-bitUnicode Transformation Format) is a variable-length character encodingformat. In alternate embodiments, other character encoding formats canbe used.

In the examples that follow, an Extended M3U format is utilized thatincludes two tags: EXTM3U and EXTINF. An Extended M3U file may bedistinguished from a basic M3U file by a first line that includes“#EXTM3U”.

EXTINF is a record marker that describes the media file identified bythe URI that follows the tag. In one embodiment, each media file URI ispreceded by an EXTINF tag, for example:

#EXTINF: <duration>,<title>

where “duration” specifies the duration of the media file and “title” isthe title of the target media file.

In one embodiment, the following tags may be used to manage the transferand playback of media files:

EXT-X-TARGETDURATION

EXT-X-MEDIA-SEQUENCE

EXT-X-KEY

EXT-X-PROGRAM-DATE-TIME

EXT-X-ALLOW-CACHE

EXT-X-STREAM-INF

EXT-X-ENDLIST

EXT-X-DISCONTINUITY

EXT-X-VERSION

These tags will each be described in greater detail below. Whilespecific formats and attributes are described with respect to each newtag, alternative embodiments can also be supported with differentattributes, names, formats, etc.

The EXT-X-TARGETDURATION tag can indicate, in one embodiment, theapproximate duration of the next media file that will be added to thepresentation. It can be included in the playback file and the format canbe:

#EXT-X-TARGETDURATION:<seconds>

where “seconds” indicates the duration of the media file. In oneembodiment, the actual duration may differ slightly from the targetduration indicated by the tag. In one embodiment, every URI indicating asegment will be associated with an approximate duration of the segment;for example, the URI for a segment may be prefixed with a tag indicatingthe approximate duration of that segment. In another embodiment, theEXT-X-TARGETDURATION tag can specify the maximum media file duration;the EXTINF duration of each media file in the playlist file should beless than or equal to the target duration, and this tag (which specifiesthe maximum media file duration) can be specified just once in theplaylist file and it applies to all media files in the playlist file,and its format can be:

#EXT-X-TARGETDURATION:<s>

where “s” is an integer indicating the target duration in seconds.

Each media file URI in a playlist file can have a unique sequencenumber. The sequence number, if present, of a URI is equal to thesequence number of the URI that preceded it, plus one in one embodiment.The EXT-X-MEDIA-SEQUENCE tag can indicate the sequence number of thefirst URI that appears in a playlist file and the format can be:

#EXT-X-MEDIA-SEQUENCE:<number>

where “number” is the sequence number of the URI. If the playlist filedoes not include a #EXT-X-MEDIA-SEQUENCE tag, the sequence number of thefirst URI in the playlist can be considered 1. A media file's sequencenumber is not required to appear in its URI in one embodiment, and inone embodiment, a playlist can contain only one EXT-X-MEDIA-SEQUENCEtag. In one embodiment, the sequence numbering can be non-sequential;for example, non-sequential sequence numbering such as 1, 5, 7, 17, etc.can make it difficult to predict the next number in a sequence and thiscan help to protect the content from pirating. Another option to helpprotect the content is to reveal only parts of a playlist at any giventime.

Some media files may be encrypted. The EXT-X-KEY tag providesinformation that can be used to decrypt media files that follow it andthe format can be:

#EXT-X-KEY:METHOD=<method>[,URI=“<URI>”][,IV=<IV>]

The METHOD parameter specifies the encryption method and the URIparameter, if present, specifies how to obtain the key and the IV(Initialization Vector), if present, specifies an initialization vectorused in the encryption method (e.g. with the key).

An encryption method of NONE indicates no encryption and if NONE isindicated then, in one embodiment, the URI and IV parameters should notbe present. Various encryption methods may be used, for example AES-128,which indicates encryption using the Advance Encryption Standardencryption with a 128-bit key and PKCS7 padding [see RFC3852]. A newEXT-X-KEY tag supersedes any prior EXT-X-KEY tags.

An EXT-X-KEY tag with a URI parameter identifies the key file. A keyfile may contain the cipher key that is to be used to decrypt subsequentmedia files listed in the playlist file. For example, the AES-128encryption method uses 16-octet keys. The format of the key file can bea packed array of 16 octets in binary format.

Use of AES-128 normally requires that the same 16-octet initializationvector (IV) be supplied when encrypting and decrypting. Varying the IVcan be used to increase the strength of the cipher. When using AES-128encryption, the sequence number of the media file can be used as the IVwhen encrypting or decrypting media files.

The EXT-X-PROGRAM-DATE-TIME tag can associate the beginning of the nextmedia file with an absolute date and/or time and can include or indicatea time zone. In one embodiment, the date/time representation is ISO/IEC8601:2004. The value of the date and time in this tag can provide aninformative mapping of the timeline of the media to an appropriatewall-clock time, which may be used as a basis for seeking, for displayor other purposes, content for playback based on a date and time. In oneembodiment, if a server provides this mapping, it should place anEXT-X-PROGRAM-DATE-TIME tag after every EXT-X-DISCONTINUITY tag in theplaylist file. The tag format can be:

EXT-X-PROGRAM-DATE-TIME:<YYYY-MM-DDThh:mm:ssZ>

The EXT-X-ALLOW-CACHE tag can be used to indicate whether the client maycache the downloaded media files for later playback. This tag can appearanywhere in the playlist file in one embodiment but, in one embodiment,should appear only once in the playlist file. The tag format can be:

EXT-X-ALLOW-CACHE:<YES|NO>

The EXT-X-ENDLIST tag indicates in one embodiment that no more mediafiles will be added to the playlist file. The tag format can be:

EXT-X-ENDLIST

In one embodiment, if a playlist contains the final segment or mediafile then the playlist will have the EXT-X-ENDLIST tag. This tag canappear, in one embodiment, anywhere in a playlist file, and in oneembodiment, it can occur only once in the playlist file.

The EXT-X-STREAM-INF tag can be used to indicate that the next URI inthe playlist file identifies another playlist file. The tag format canbe, in one embodiment:

EXT-X-STREAM-INF:[attribute=value][,attribute=value]*<URI>

where the following attributes may be used. An attribute of the sametype, in one embodiment of this tag, should not appear more than once inthe same tag. The attribute BANDWIDTH=<n> is an approximate upper boundof the stream bit rate expressed as a number of bits per second. In oneembodiment, the attribute BANDWIDTH can be an upper bound of the overallbitrate of each media file, calculated to include container overheadthat appears or will appear in the playlist. The attributePROGRAM-ID=<i> is a number that uniquely identifies a particularpresentation within the scope of the playlist file. A playlist file mayinclude multiple EXT-X-STREAM-INF URIs with the same PROGRAM-ID todescribe variant streams of the same presentation and these variantplaylists can contain additional EXT-X-STREAM-INF tags. Variant streamsand variant playlists are described further in this disclosure (e.g. seeFIGS. 9A-9D). The attribute CODECS=“[format][,format]*” can be used tospecify a media sample type that is present in a media file in theplaylist file, where each format specifies a media sample type; in oneembodiment, valid format identifiers can be those in the ISO File FormatName Space defined by RFC 4281. The attribute RESOLUTION=<N>×<M> canspecify a resolution of video within the stream, where N is theapproximate encoded horizontal resolution of video within the stream,which can be expressed as a number of pixels, and M is the approximateencoded vertical resolution.

The EXT-X-DISCONTINUITY tag indicates an encoding discontinuity betweenthe media file that follows it and the one that preceded it. The set ofcharacteristics that MAY change is:

-   -   file format    -   number and type of tracks    -   encoding parameters    -   encoding sequence    -   timestamp sequence        Its format is:

#EXT-X-DISCONTINUITY

The EXT-X-VERSION tag indicates the compatibility version of theplaylist file. The playlist file, its associated media, and its servershould, in one embodiment, comply with all provisions of the most-recentversion of this document describing the protocol version indicated bythe tag value. Its format is:

#EXT-X-VERSION:<n>

where “n” is an integer indicating the protocol version.

A playlist file, in one embodiment, can contain no more than oneEXT-X-VERSION tag. A playlist file that does not contain anEXT-X-VERSION tag should, in one embodiment, comply with version 1 ofthis protocol. If the playlist file has this tag then its value, in oneembodiment, should be the lowest protocol version with which the server,playlist file and associated media files all comply.

The foregoing tags and attributes can be used by the server device toorganize, transmit and process the media files that represent theoriginal media content. The client devices use this information toreassemble and present the media files in a manner to provide areal-time, or near real-time, streaming experience (e.g. viewing of alive broadcast such as a music or sporting event) to a user of theclient device.

Each media file URI in a playlist file identifies a media file that is asegment of the original presentation (i.e., original media content). Inone embodiment, each media file is formatted as a MPEG-2 transportstream, a MPEG-2 program stream, or a MPEG-2 audio elementary stream.The format can be specified by specifying a CODEC, and the playlist canspecify a format by specifying a CODEC. In one embodiment, all mediafiles in a presentation have the same format; however, multiple formatsmay be supported in other embodiments. A transport stream file should,in one embodiment, contain a single MPEG-2 program, and there should bea Program Association Table and a Program Map Table at the start of eachfile. A file that contains video SHOULD have at least one key frame andenough information to completely initialize a video decoder. A mediafile in a playlist MUST be the continuation of the encoded stream at theend of the media file with the previous sequence number unless it wasthe first media file to appear in the playlist file or if it is precededby an EXT-X-DISCONTINUITY tag. Clients SHOULD be prepared to handlemultiple tracks of a particular type (e.g. audio or video) by choosing areasonable subset. Clients should, in one embodiment, ignore privatestreams inside Transport Streams that they do not recognize. Theencoding parameters for samples within a stream inside a media file andbetween corresponding streams across multiple media files SHOULD remainconsistent. However clients SHOULD deal with encoding changes as theyare encountered, for example by scaling video content to accommodate aresolution change.

FIG. 2A is a flow diagram of one embodiment of a technique for one ormore server devices to support media content using non-streamingprotocols. The example of FIG. 2A is provided in terms of HTTP; however,other non-streaming protocols can be utilized in a similar manner. Theexample of FIG. 2A is provided in terms of a single server performingcertain tasks. However, any number of servers may be utilized. Forexample, the server that provides media files to client devices may be adifferent device than a server that segments the content into multiplemedia files.

The server device receives content to be provided in operation 200. Thecontent may represent live audio and/or video (e.g., a sporting event,live news, a Web camera feed). The content may also representpre-recorded content (e.g., a concert that has been recorded, a trainingseminar, etc.). The content may be received by the server according toany format and protocol known in the art, whether streamed or not. Inone embodiment, the content is received by the server in the form of aMPEG-2 stream; however, other formats can also be supported.

The server may then store temporarily at least portions of the contentin operation 210. The content or at least portions of the content may bestored temporarily, for example, on a storage device (e.g., hard disk ina Storage Area Network, etc.) or in memory. Alternatively, the contentmay be received as via a storage medium (e.g., compact disc, flashdrive) from which the content may be transferred to a storage device ormemory. In one embodiment, the server has an encoder that converts, ifnecessary, the content to one or more streams (e.g., MPEG-2). Thisconversion can occur without storing permanently the received content,and in some embodiments, the storage operation 210 may be omitted or itmay be a longer term storage (e.g. an archival storage) in otherembodiments.

The content to be provided is segmented into multiple media files inoperation 220. In one embodiment, the server converts a stream intoseparate and distinct media files (i.e., segments) that can bedistributed using a standard web server. In one embodiment, the serversegments the media stream at points that support effective decode of theindividual media files (e.g., on packet and key frame boundaries such asPES packet boundaries and i-frame boundaries). The media files can beportions of the original stream with approximately equal duration. Theserver also creates a URI for each media file. These URIs allow clientdevices to access the media files.

Because the segments are served using HTTP servers, which inherentlydeliver whole files, the server should have a complete segmented mediafile available before it can be served to the clients. Thus, the clientmay lag (in time) the broadcast by at least one media file length. Inone embodiment, media file size is based on a balance between lag timeand having too many files.

In one embodiment, two session types (live session and event session)are supported. For a live session, only a fixed size portion of thestream is preserved. In one embodiment, content media files that are outof date are removed from the program playlist file, and can be removedfrom the server. The second type of session is an event session, wherethe client can tune into any point of the broadcast (e.g., start fromthe beginning, start from a mid-point). This type of session can be usedfor rebroadcast, for example.

The media files are stored in the server memory in operation 230. Themedia files can be protected by a security feature, such as encryption,before storing the files in operation 230. The media files are stored asfiles that are ready to transmit using the network protocol (e.g., HTTPor HTTPS) supported by the Web server application on the server device(or supported by another device which does the transmission).

One or more playlist files are generated to indicate the order in whichthe media files should be assembled to recreate the original content inoperation 240. The playlist file(s) can utilize Extended M3U tags andthe tags described herein to provide information for a client device toaccess and reassemble the media files to provide a streaming experienceon the client device. A URI for each media file is included in theplaylist file(s) in the order in which the media files are to be played.The server can also create one or more URIs for the playlist file(s) toallow the client devices to access the playlist file(s).

The playlist file(s) can be stored on the server in operation 250. Whilethe creation and storing of media files and playlist file(s) arepresented in a particular order in FIG. 2A, a different order may alsobe used. For example, the playlist file(s) may be created before themedia files are created or stored. As another example, the playlistfile(s) and media files may be created before either are stored.

If media files are to be encrypted the playlist file(s) can define a URIthat allows authorized client devices to obtain a key file containing anencryption key to decrypt the media files. An encryption key can betransmitted using a secure connection (e.g., HTTPS). As another example,the playlist file(s) may be transmitted using HTTPS. As a furtherexample, media files may be arranged in an unpredictable order so thatthe client cannot recreate the stream without the playlist file(s).

If the encryption method is AES-128, AES-128 CBC encryption, forexample, may be applied to individual media files. In one embodiment,the entire file is encrypted. Cipher block chaining is normally notapplied across media files in one embodiment. The sequence number of themedia files can be used as the IV or the IV can be the value of the IVattribute of the EXT-X-KEY tag as described above. In one embodiment,the server adds an EXT-X-KEY tag with the key URI to the end of theplaylist file. The server then encrypts all subsequent media files withthat key until a change in encryption configuration is made.

To switch to a new encryption key, the server can make the new keyavailable via a new URI that is distinct from all previous key URIs usedin the presentation. The server also adds an EXT-X-KEY tag with the newkey URI to the end of a playlist file and encrypts all subsequent mediafiles with the new key.

To end encryption, the server can add an EXT-X-KEY tag with theencryption method NONE at the end of the playlist file. The tag (with“NONE” as the method) does not include a URI parameter in oneembodiment. All subsequent media files are not encrypted until a changein encryption configuration is made as described above. The server doesnot remove an EXT-X-KEY tag from a playlist file if the playlist filecontains a URI to a media file encrypted with that key. The server cantransmit the playlist file(s) and the media files over the network inresponse to client requests in operation 270, as described in moredetail with respect to FIG. 3A.

In one embodiment, a server transmits the playlist file to a clientdevice in response to receiving a request from a client device for aplaylist file. The client device may access/request the playlist fileusing a URI that has been provided to the client device. The URIindicates the location of the playlist file on the server. In response,the server may provide the playlist file to the client device. Theclient device may the utilize tags and URIs (or other identifiers) inthe playlist file to access the multiple media files.

In one embodiment, the server may limit the availability of media filesto those that have been most recently added to the playlist file(s). Todo this, each playlist file can include only one EXT-X-MEDIA-SEQUENCEtag and the value can be incremented by one for every media file URIthat is removed from the playlist file. Media file URIs can be removedfrom the playlist file(s) in the order in which they were added. In oneembodiment, when the server removes a media file URI from the playlistfile(s) the media file remains available to clients for a period of timeequal to the duration of the media file plus the duration of the longestplaylist file in which the media file has appeared.

The duration of a playlist file is the sum of the durations of the mediafiles within that playlist file. Other durations can also be used. Inone embodiment, the server can maintain at least three main presentationmedia files in the playlist at all times unless the EXT-X-ENDLIST tag ispresent.

FIG. 2B is a flow diagram of one embodiment of a technique for one ormore server devices to provide dynamically updated playlists to one ormore client devices. The playlists can be updated using either of thecumulative mode or the rolling mode described herein. The example ofFIG. 2B is provided in terms of HTTP; however, other non-streamingprotocols (e.g. HTTPS, etc.) can be utilized in a similar manner. Theexample of FIG. 2B is provided in terms of a server performing certaintasks. However, any number of servers may be utilized. For example, theserver that provides media files to client devices may be a differentdevice than the server that segments the content into multiple mediafiles.

The server device receives content to be provided in operation 205. Theserver may then temporarily store at least portions of the content inoperation 215. Operation 215 can be similar to operation 210 in FIG. 2A.The content to be provided is segmented into multiple media files inoperation 225. The media files can be stored in the server memory inoperation 235. The media files can be protected by a security feature,such as encryption, before storing the files in operation 235.

One or more playlist files are generated to indicate the order in whichthe media files should be assembled to recreate the original content inoperation 245. The playlist file(s) can be stored on the server inoperation 255. While the creation and storing of media files andplaylist file(s) are presented in a particular order in FIG. 2B, adifferent order may also be used.

The server (or another server) can transmit the playlist file(s) and themedia files over the network in response to client requests in operation275, as described in more detail with respect to FIGS. 3A-3B.

The playlist file(s) may be updated by a server for various reasons. Theserver may receive additional data to be provided to the client devicesin operation 285. The additional data can be received after the playlistfile(s) are stored in operation 255. The additional data may be, forexample, additional portions of a live presentation, or additionalinformation for an existing presentation. Additional data may includeadvertisements or statistics (e.g. scores or data relating to a sportingevent). The additional data could be overlaid (through translucency) onthe presentation or be presented in a sidebar user interface. Theadditional data can be segmented in the same manner as the originallyreceived data. If the additional data constitutes advertisements, orother content to be inserted into the program represented by theplaylist, the additional data can be stored (at least temporarily) inoperation 215, segmented in operation 225 and stored in operation 235;prior to storage of the segmented additional data, the segments of theadditional data can be encrypted. Then in operation 245 an updatedplaylist, containing the program and the additional data, would begenerated. The playlist is updated based on the additional data andstored again in operation 255. Changes to the playlist file(s) should bemade atomically from the perspective of the client device. The updatedplaylist replaces, in one embodiment, the previous playlist. Asdiscussed below in greater detail, client devices can request theplaylist multiple times. These requests enable the client devices toutilize the most recent playlist. In one embodiment, the additional datamay be metadata; in this case, the playlist does not need to be updated,but the segments can be updated to include metadata. For example, themetadata may contain timestamps which can be matched with timestamps inthe segments, and the metadata can be added to segments having matchingtimestamps.

The updated playlist may also result in the removal of media files. Inone embodiment, a server should remove URIs, for the media files, fromthe playlist in the order in which they were added to the playlist. Inone embodiment, if the server removes an entire presentation, it makesthe playlist file(s) unavailable to client devices. In one embodiment,the server maintains the media files and the playlist file(s) for theduration of the longest playlist file(s) containing a media file to beremoved to allow current client devices to finish accessing thepresentation. Accordingly, every media file URI in the playlist file canbe prefixed with an EXT-X-STREAM-INF tag to indicate the approximatecumulative duration of the media files indicated by the playlist file.In alternate embodiments, the media files and the playlist file(s) maybe removed immediately.

Subsequent requests for the playlist from client devices result in theserver providing the updated playlist in operation 275. In oneembodiment, playlists are updated on a regular basis, for example, aperiod of time related to the target duration. Periodic updates of theplaylist file allow the server to provide access to servers to adynamically changing presentation.

FIG. 2C is a flow diagram of one embodiment of a technique for one ormore server devices to provide media content to client devices usingmultiple bit rates, which is one form of the use of alternative streams.The example of FIG. 2C is provided in terms of HTTP; however, othernon-streaming protocols can be utilized in a similar manner. The exampleof FIG. 2C is provided in terms of a server performing certain tasks.However, any number of servers may be utilized. For example, the serverthat provides media files to client devices may be a different devicethan a server that segments the content into multiple media files.

In one embodiment, the server can offer multiple playlist files or asingle playlist file with multiple media file lists in the singleplaylist file to provide different encodings of the same presentation.If different encodings are provided, playlist file(s) may include eachvariant stream providing different bit rates to allow client devices toswitch between encodings dynamically (this is described further inconnection with FIGS. 9A-9D). Playlist files having variant streams caninclude an EXT-X-STREAM-INF tag for each variant stream. EachEXT-X-STREAM-INF tag for the same presentation can have the samePROGRAM-ID attribute value. The PROGRAM-ID value for each presentationis unique within the variant streams.

In one embodiment, the server meets the following constraints whenproducing variant streams. Each variant stream can consist of the samecontent including optional content that is not part of the mainpresentation. The server can make the same period of content availablefor all variant streams within an accuracy of the smallest targetduration of the streams. The media files of the variant streams are, inone embodiment, either MPEG-2 Transport Streams or MPEG-2 ProgramStreams with sample timestamps that match for corresponding content inall variant streams. Also, all variant streams should, in oneembodiment, contain the same audio encoding. This allows client devicesto switch between variant streams without losing content.

Referring to FIG. 2C, the server device receives content to be providedin operation 202. The server may then at least temporarily store thecontent in operation 212. The content to be provided is segmented intomultiple media files in operation 222. Each media file is encoded for aselected bit rate (or a selected value of other encoding parameters) andstored on the server in operation 232. For example, the media files maybe targeted for high-, medium- and low-bandwidth connections. The mediafiles can be encrypted prior to storage. The encoding of the media filestargeted for the various types of connections may be selected to providea streaming experience at the target bandwidth level.

In one embodiment, a variant playlist is generated in operation 242 withtags as described herein that indicate various encoding levels. The tagsmay include, for example, an EXT-X-STREAM-INF tag for each encodinglevel with a URI to a corresponding media playlist file.

This variant playlist can include URIs to media playlist files for thevarious encoding levels. Thus, a client device can select a target bitrate from the alternatives provided in the variant playlist indicatingthe encoding levels and retrieve the corresponding playlist file. In oneembodiment, a client device may change between bit rates during playback(e.g. as described with respect to FIGS. 9A-9D). The variant playlistindicating the various encoding levels is stored on the server inoperation 252. In operation 242, each of the playlists referred to inthe variant playlist can also be generated and then stored in operation252.

In response to a request from a client device, the server may transmitthe variant playlist that indicates the various encoding levels inoperation 272. The server may receive a request for one of the mediaplaylists specified in the variant playlist corresponding to a selectedbit rate in operation 282. In response to the request, the servertransmits the media playlist file corresponding to the request from theclient device in operation 292. The client device may then use the mediaplaylist to request media files from the server. The server provides themedia files to the client device in response to requests in operation297.

FIG. 3A is a flow diagram of one embodiment of a technique for a clientdevice to support streaming of content using non-streaming protocols.The example of FIG. 3A is provided in terms of HTTP; however, othernon-streaming protocols can be utilized in a similar manner. The methodsshown in FIGS. 3A-3B can be performed by one client device or by severalseparate client devices. For example, in the case of any one of thesemethods, a single client device may perform all of the operations (e.g.request a playlist file, request media files using URIs in the playlistfile, assemble the media files to generate and provide apresentation/output) or several distinct client devices can perform somebut not all of the operations (e.g. a first client device can request aplaylist file and request media files using URIs in the playlist fileand can store those media files for use by a second client device whichcan process the media files to generate and provide apresentation/output).

The client device may request a playlist file from a server in operation300. In one embodiment, the request is made according to anHTTP-compliant protocol. The request utilizes a URI to an initialplaylist file stored on the server. In alternate embodiments, othernon-streaming protocols can be supported. In response to the request,the server will transmit the corresponding playlist file to the clientover a network. As discussed above, the network can be wired or wirelessand can be any combination of wired or wireless networks. Further, thenetwork may be a data network (e.g., IEEE 802.11, IEEE 802.16) or acellular telephone network (e.g., 3G).

The client device can receive the playlist file in operation 310. Theplaylist file can be stored in a memory of the client device inoperation 320. The memory can be, for example, a hard disk, a flashmemory, a random-access memory. In one embodiment, each time a playlistfile is loaded or reloaded from the playlist URI, the client checks todetermine that the playlist file begins with a #EXTM3U tag and does notcontinue if the tag is absent. As discussed above, the playlist fileincludes one or more tags as well as one or more URIs to media files.

The client device can include an assembler agent that uses the playlistfile to reassemble the original content by requesting media filesindicated by the URIs in the playlist file in operation 330. In oneembodiment, the assembler agent is a plug-in module that is part of astandard Web browser application. In another embodiment, the assembleragent may be a stand-alone application that interacts with a Web browserto receive and assemble the media files using the playlist file(s). As afurther example, the assembler agent may be a special-purpose hardwareor firmware component that is embedded in the client device.

The assembler causes media files from the playlist file to be downloadedfrom the server indicated by the URIs. If the playlist file contains theEXT-X-ENDLIST tag, any media file indicated by the playlist file may beplayed first. If the EXT-X-ENDLIST tag is not present, any media fileexcept for the last and second-to-last media files may be played first.Once the first media file to play has been chosen, subsequent mediafiles in the playlist file are loaded, in one embodiment, in the orderthat they appear in the playlist file (otherwise the content ispresented out of order). In one embodiment, the client device attemptsto load media files in advance of when they are required (and storesthem in a buffer) to provide uninterrupted playback and to compensatefor temporary variations in network latency and throughput.

The downloaded media file(s) can be stored in a memory on the clientdevice in operation 340. The memory in which the content can be storedmay be any type of memory on the client device, for example,random-access memory, a hard disk, or a video buffer. The storage may betemporary to allow playback or may be permanent. If the playlist filecontains the EXT-X-ALLOW-CACHE tag and its value is NO, the client doesnot store the downloaded media files after they have been played. If theplaylist contains the EXT-X-ALLOW-CACHE tag and its value is YES, theclient device may store the media files indefinitely for later replay.The client device may use the value of the EXT-X-PROGRAM-DATE-TIME tagto display the program origination time to the user. In one embodiment,the client can buffer multiple media files so that it is lesssusceptible to network jitter, in order to provide a better userexperience.

In one embodiment, if the decryption method is AES-128, then AES-128 CBCdecryption is applied to the individual media files. The entire file isdecrypted. In one embodiment, cipher block chaining is not appliedacross media files. The sequence number of the media file can be used asthe initialization vector as described above.

From the memory, the content can be output from the client device inoperation 350. The output or presentation may be, for example, audiooutput via built-in speakers or head phones. The output may includevideo that is output via a screen or projected from the client device.Any type of output known in the art may be utilized. In operation 351,the client device determines whether there are any more media files inthe stored, current playlist which have not been played or otherwisepresented. If such media files exist (and if they have not beenrequested) then processing returns to operation 330 in which one or moremedia files are requested and the process repeats. If there are no suchmedia files (i.e., all media files in the current playlist have beenplayed), then processing proceeds to operation 352, which determineswhether the playlist file includes an end tag.

If the playlist includes an end tag (e.g., EXT-X-ENDLIST) in operation352, playback ceases when the media files indicated by the playlist filehave been played. If the end tag is not in the playlist, then the clientdevice requests a playlist again from the server and reverts back tooperation 300 to obtain a further or updated playlist for the program.

As discussed in greater detail with respect to FIG. 2B, a server mayupdate a playlist file to introduce supplementary content (e.g.,additional media file identifiers corresponding to additional mediacontent in a live broadcast) or additional content (e.g. content furtherdown the stream). To access the supplementary content or additionalcontent, a client can reload the updated playlist from the server. Thiscan provide a mechanism by which playlist files can be dynamicallyupdated, even during playback of the media content associated with aplaylist file. A client can request a reload of the playlist file basedon a number of triggers. The lack of an end tag is one such trigger.

In one embodiment, the client device periodically reloads the playlistfile(s) unless the playlist file contains the EXT-X-ENDLIST tag. Whenthe client device loads a playlist file for the first time or reloads aplaylist file and finds that the playlist file has changed since thelast time it was loaded, the client can wait for a period of time beforeattempting to reload the playlist file again. This period is called theinitial minimum reload delay. It is measured from the time that theclient began loading the playlist file.

In one embodiment, the initial minimum reload delay is the duration ofthe last media file in the playlist file or three times the targetduration, whichever is less. The media file duration is specified by theEXTINF tag. If the client reloads a playlist file and finds that it hasnot changed then the client can wait for a period of time beforeretrying. The minimum delay in one embodiment is three times the targetduration or a multiple of the initial minimum reload delay, whichever isless. In one embodiment, this multiple is 0.5 for a first attempt, 1.5for a second attempt and 3.0 for subsequent attempts; however, othermultiples may be used.

Each time a playlist file is loaded or reloaded, the client deviceexamines the playlist file to determine the next media file to load. Thefirst file to load is the media file selected to play first as describedabove. If the first media file to be played has been loaded and theplaylist file does not contain the EXT-X-MEDIA-SEQUENCE tag then theclient can verify that the current playlist file contains the URI of thelast loaded media file at the offset where it was originally found,halting playback if the file is not found. The next media file to loadcan be the first media file URI following the last-loaded URI in theplaylist file.

If the first file to be played has been loaded and the playlist filecontains the EXT-X-MEDIA-SEQUENCE tag, then the next media file to loadcan be the one with the lowest sequence number that is greater than thesequence number of the last media file loaded. If the playlist filecontains an EXT-X-KEY tag that specifies a key file URI, the clientdevice obtains the key file and uses the key inside the key file todecrypt the media files following the EXT-X-KEY tag until anotherEXT-X-KEY tag is encountered.

In one embodiment, the client device utilizes the same URI as previouslyused to download the playlist file. Thus, if changes have been made tothe playlist file, the client device may use the updated playlist fileto retrieve media files and provide output based on the media files.

Changes to the playlist file may include, for example, deletion of a URIto a media file, addition of a URI to a new media file, replacement of aURI to a replacement media file. When changes are made to the playlistfile, one or more tags may be updated to reflect the change(s). Forexample, the duration tag may be updated if changes to the media filesresult in a change to the duration of the playback of the media filesindicated by the playlist file.

FIG. 3B is a flow diagram of one embodiment of a technique for a clientdevice to support streaming of content using multiple bit rates which isone form of alternative streams. The example of FIG. 3B is provided interms of HTTP; however, other non-streaming protocols can be utilized ina similar manner.

The client device can request a playlist file in operation 370. Asdiscussed above, the playlist file may be retrieved utilizing a URIprovided to the client device. In one embodiment, the playlist fileincludes listings of variant streams of media files to provide the samecontent at different bit rates; in other words, a single playlist fileincludes URIs for the media files of each of the variant streams. Theexample shown in FIG. 3B uses this embodiment. In another embodiment,the variant streams may be represented by multiple distinct playlistfiles separately provided to the client that each provides the samecontent at different bit rates, and a variant playlist can provide a URIfor each of the distinct playlist files. This allows the client deviceto select the bit rate based on client conditions.

The playlist file(s) can be retrieved by the client device in operation375. The playlist file(s) can be stored in the client device memory inoperation 380. The client device may select the bit rate to be used inoperation 385 based upon current network connection speeds. Media filesare requested from the server utilizing URIs included in the playlistfile corresponding to the selected bit rate in operation 390. Theretrieved media files can be stored in the client device memory. Outputis provided by the client device utilizing the media files in operation394 and the client device determines whether to change the bit rate.

In one embodiment, a client device selects the lowest available bit rateinitially. While playing the media, the client device can monitoravailable bandwidth (e.g. current network connection bit rates) todetermine whether the available bandwidth can support use of a higherbit rate for playback. If so, the client device can select a higher bitrate and access the media files indicated by the higher bit rate mediaplaylist file. The reverse can also be supported. If the playbackconsumes too much bandwidth, the client device can select a lower bitrate and access the media files indicated by the lower bit rate mediaplaylist file.

If the client device changes the bit rate in operation 394, for example,in response to a change in available bandwidth or in response to userinput, the client device may select a different bit rate in operation385. In one embodiment, to select a different bit rate the client devicemay utilize a different list of URIs included in the playlist file thatcorresponds to the new selected bit rate. In one embodiment, the clientdevice may change bit rates during access of media files within aplaylist.

If the bit rate does not change in operation 394, then the client devicedetermines whether there are any more unplayed media files in thecurrent playlist which have not been retrieved and presented. If suchmedia files exist, then processing returns to operation 390 and one ormore media files are retrieved using the URIs for those files in theplaylist. If there are no such media files (i.e. all media files in thecurrent playlist haven been played), then processing proceeds tooperation 396 in which it is determined whether the playlist includes anend tag. If it does, the playback of the program has ended and theprocess has completed; if it does not, then processing reverts tooperation 370, and the client device requests to reload the playlist forthe program, and the process repeats through the method shown in FIG.3B.

FIG. 4 is a block diagram of one embodiment of a server stream agent. Itwill be understood that the elements of server stream agent 400 can bedistributed across several server devices. For example, a first serverdevice can include the segmenter 430, the indexer 440 and security 450but not the file server 460 and a second server device can include thefile server 450 but not the segmenter 430, the indexer 440 and security450. In this example, the first server device would prepare theplaylists and media files but would not transmit them to client deviceswhile one or more second server devices would receive and optionallystore the playlists and media files and would transmit the playlists andmedia files to the client devices. Server stream agent 400 includescontrol logic 410, which implements logical functional control to directoperation of server stream agent 400, and hardware associated withdirecting operation of server stream agent 400. Logic may be hardwarelogic circuits or software routines or firmware. In one embodiment,server stream agent 400 includes one or more applications 412, whichrepresent code sequence and/or programs that provide instructions tocontrol logic 410.

Server stream agent 400 includes memory 414, which represents a memorydevice or access to a memory resource for storing data or instructions.Memory 414 may include memory local to server stream agent 400, as wellas, or alternatively, including memory of the host system on whichserver stream agent 400 resides. Server stream agent 400 also includesone or more interfaces 416, which represent access interfaces to/from(an input/output interface) server stream agent 400 with regard toentities (electronic or human) external to server stream agent 400.

Server stream agent 400 also can include server stream engine 420, whichrepresents one or more functions that enable server stream agent 400 toprovide the real-time, or near real-time, streaming as described herein.The example of FIG. 4 provides several components that may be includedin server stream engine 420; however, different or additional componentsmay also be included. Example components that may be involved inproviding the streaming environment include segmenter 430, indexer 440,security 450 and file server 460. Each of these components may furtherinclude other components to provide other functions. As used herein, acomponent refers to routine, a subsystem, etc., whether implemented inhardware, software, firmware or some combination thereof.

Segmenter 430 divides the content to be provided into media files thatcan be transmitted as files using a Web server protocol (e.g., HTTP).For example, segmenter 430 may divide the content into predetermined,fixed-size blocks of data in a pre-determined file format.

Indexer 440 may provide one or more playlist files that provide anaddress or URI to the media files created by segmenter 430. Indexer 440may, for example, create one or more files with a listing of an orderfor identifiers corresponding to each file created by segmenter 430. Theidentifiers may be created or assigned by either segmenter 430 orindexer 440. Indexer 440 can also include one or more tags in theplaylist files to support access and/or utilization of the media files.

Security 450 may provide security features (e.g. encryption) such asthose discussed above. Web server 460 may provide Web serverfunctionality related to providing files stored on a host system to aremote client device. Web server 460 may support, for example,HTTP-compliant protocols.

FIG. 5 is a block diagram of one embodiment of a client stream agent. Itwill be understood that the elements of a client stream agent can bedistributed across several client devices. For example, a first clientdevice can include an assembler 530 and security 550 and can provide adecrypted stream of media files to a second client device that includesan output generator 540 (but does not include an assembler 530 andsecurity 550). In another example, a primary client device can retrieveplaylists and provide them to a secondary client device which retrievesmedia files specified in the playlist and generates an output to presentthese media files. Client stream agent 500 includes control logic 510,which implements logical functional control to direct operation ofclient stream agent 500, and hardware associated with directingoperation of client stream agent 500. Logic may be hardware logiccircuits or software routines or firmware. In one embodiment, clientstream agent 500 includes one or more applications 512, which representcode sequence or programs that provide instructions to control logic510.

Client stream agent 500 includes memory 514, which represents a memorydevice or access to a memory resource for storing data and/orinstructions. Memory 514 may include memory local to client stream agent500, as well as, or alternatively, including memory of the host systemon which client stream agent 500 resides. Client stream agent 500 alsoincludes one or more interfaces 516, which represent access interfacesto/from (an input/output interface) client stream agent 500 with regardto entities (electronic or human) external to client stream agent 500.

Client stream agent 500 also can include client stream engine 520, whichrepresents one or more functions that enable client stream agent 500 toprovide the real-time, or near real-time, streaming as described herein.The example of FIG. 5 provides several components that may be includedin client stream engine 520; however, different or additional componentsmay also be included. Example components that may be involved inproviding the streaming environment include assembler 530, outputgenerator 540 and security 550. Each of these components may furtherinclude other components to provide other functions. As used herein, acomponent refers to routine, a subsystem, etc., whether implemented inhardware, software, firmware or some combination thereof.

Assembler 530 can utilize a playlist file received from a server toaccess the media files via Web server protocol (e.g., HTTP) from theserver. In one embodiment, assembler 530 may cause to be downloadedmedia files as indicated by URIs in the playlist file. Assembler 530 mayrespond to tags included in the playlist file.

Output generator 540 may provide the received media files as audio orvisual output (or both audio and visual) on the host system. Outputgenerator 540 may, for example, cause audio to be output to one or morespeakers and video to be output to a display device. Security 550 mayprovide security features such as those discussed above.

FIG. 6 illustrates one embodiment of a playlist file with multiple tags.The example playlist of FIG. 6 includes a specific number and orderingof tags. This is provided for description purposes only. Some playlistfiles may include more, fewer or different combinations of tags and thetags can be arranged in a different order than shown in FIG. 6.

Begin tag 610 can indicate the beginning of a playlist file. In oneembodiment, begin tag 610 is a #EXTM3U tag. Duration tag 620 canindicate the duration of the playback list. That is, the duration of theplayback of the media files indicated by playback list 600. In oneembodiment, duration tag 620 is an EXT-X-TARGETDURATION tag; however,other tags can also be used.

Date/Time tag 625 can provide information related to the date and timeof the content provided by the media files indicated by playback list600. In one embodiment, Date/Time tag 625 is an EXT-X-PROGRAM-DATE-TIMEtag; however, other tags can also be used. Sequence tag 630 can indicatethe sequence of playlist file 600 in a sequence of playlists. In oneembodiment, sequence tag 630 is an EXT-X-MEDIA-SEQUENCE tag; however,other tags can also be used.

Security tag 640 can provide information related to security and/orencryption applied to media files indicated by playlist file 600. Forexample, the security tag 640 can specify a decryption key to decryptfiles specified by the media file indicators. In one embodiment,security tag 640 is an EXT-X-KEY tag; however, other tags can also beused. Variant list tag 645 can indicate whether variant streams areprovided by playlist 600 as well as information related to the variantstreams (e.g., how many, bit rate). In one embodiment, variant list tag645 is an EXT-X-STREAM-INF tag.

Media file indicators 650 can provide information related to media filesto be played. In one embodiment, media file indicators 650 include URIsto multiple media files to be played. In one embodiment, the order ofthe URIs in playlist 600 corresponds to the order in which the mediafiles should be accessed and/or played. Subsequent playlist indictors660 can provide information related to one or more playback files to beused after playback file 600. In one embodiment, subsequent playlistindicators 660 can include URIs to one or more playlist files to be usedafter the media files of playlist 600 have been played.

Memory tag 670 can indicate whether and/or how long a client device maystore media files after playback of the media file content. In oneembodiment, memory tag 670 is an EXT-X-ALLOW-CACHE tag. End tag 680indicates whether playlist file 600 is the last playlist file for apresentation. In one embodiment, end tag 680 is an EXT-X-ENDLIST tag.

The following section contains several example playlist files accordingto one embodiment.

  Simple Playlist file #EXTM3U #EXT-X-TARGETDURATION:10 #EXTINF:5220,http://media.example.com/entire.ts #EXT-X-ENDLIST Sliding WindowPlaylist, using HTTPS #EXTM3U #EXT-X-TARGETDURATION:8#EXT-X-MEDIA-SEQUENCE:2680 #EXTINF:8,https://priv.example.com/fileSequence2680.ts #EXTINF:8,https://priv.example.com/fileSequence2681.ts #EXTINF:8,https://priv.example.com/fileSequence2682.ts Playlist file withencrypted media files #EXTM3U #EXT-X-MEDIA-SEQUENCE:7794#EXT-X-TARGETDURATION:15 #EXT-X-KEY:METHOD=AES-128,URI=“https://priv.example.com/key.php?r=52” #EXTINF:15,http://media.example.com/fileSequence7794.ts #EXTINF:15,http://media.example.com/fileSequence7795.ts #EXTINF:15,http://media.example.com/fileSequence7796.ts#EXT-X-KEY:METHOD=AES-128,URI=“ https://priv.example.com/key.php?r=53”#EXTINF:15, http://media.example.com/fileSequence7797.ts VariantPlaylist file #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1280000http://example.com/low.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2560000 http://example.com/mid.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=7680000http://example.com/hi.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=65000,CODECS=“mp4a.40.5”http://example.com/audio-only.m3u8

FIG. 7 is a flow diagram of one embodiment of a playback technique forassembled streams as described herein. In one embodiment, playback ofthe received media files can be controlled by the user to start, stop,rewind, etc. The playlist file is received by the client device inoperation 700. The media files indicated by the playlist file areretrieved in operation 710. Output is generated based on the receivedmedia files in operation 720. Receiving and generating output based onmedia files can be accomplished as described above.

If control input is detected in operation 730, the client device candetermine if the input indicates a stop in operation 740. If the inputis a stop, the process concludes and playback stops. If the inputindicates a rewind or forward request in operation 750, the clientdevice can generate output based on previously played media files stillstored in memory in operation 760. If these files are no longer in acache, then processing reverts to operation 710 to retrieve the mediafiles and repeats the process. In an alternate embodiment, playback cansupport a pause feature that halts playback without concluding playbackas with a stop input.

Methods for transitioning from one stream to another stream are furtherdescribed with reference to FIGS. 9A-9D. One client device can performeach of these methods or the operations of each of these methods can bedistributed across multiple client devices as described herein; forexample, in the distributed case, one client device can retrieve thevariant playlist and the two media playlists and provide those toanother client device which retrieves media files specified by the twomedia playlists and switches between the two streams provided by theretrieved media files. It will also be understood that, in alternativeembodiments, the order of the operations shown may be modified or therecan be more or fewer operations than shown in these figures. The methodscan use a variant playlist to select different streams. A variantplaylist can be retrieved and processed in operation 901 to determineavailable streams for a program (e.g. a sporting event). Operation 901can be done by a client device. A first stream can be selected from thevariant playlist in operation 903, and a client device can then retrievea media playlist for the first stream. The client device can process themedia playlist for the first stream in operation 905 and also measure orotherwise determine a bit rate of the network connection for the firststream in operation 907. It will be appreciated that the sequence ofoperations may be performed in an order which is different than what isshown in FIG. 9A; for example, operation 907 may be performed duringoperation 903, etc. In operation 911 the client device selects analternative media playlist from the variant playlist based on themeasured bit rate from operation 907; this alternative media playlistmay be at a second bit rate that is higher than the existing bit rate ofthe first stream. This typically means that alternative stream will havea higher resolution than the first stream. The alternative mediaplaylist can be selected if it is a better match than the currentplaylist for the first stream based on current conditions (e.g. the bitrate measured in operation 907). In operation 913, the alternative mediaplaylist for an alternate stream is retrieved and processed. Thistypically means that the client device can be receiving and processingboth the first stream and the alternative stream so both are availablefor presentation; one is presented while the other is ready to bepresented. The client device then selects a transition point to switchbetween the versions of the streams in operation 915 and stopspresenting the first stream and begins presenting the alternativestream. Examples of how this switch is accomplished are provided inconjunction with FIGS. 9B-9D. In some embodiments, the client device canstop receiving the first stream before making the switch.

FIG. 9B shows that the client device retrieves, stores and presentscontent specified by the first media playlist (e.g. the first stream) inoperations 921 and 923, and while the content specified by the firstplaylist is being presented the client device in operation 925 alsoretrieves and stores content specified by the second media playlist(e.g. the second stream). The retrieval and storage (e.g. in a temporarybuffer) of the content specified by the second media playlist whilepresenting the content obtained from the first media playlist creates anoverlap 955 in time of the program's content (shown in FIG. 9D) thatallows the client device to switch between the versions of the programwithout a substantial interruption of the program. In this way, theswitch between the versions of the program can be achieved in many caseswithout the user noticing that a switch has occurred (although the usermay notice a higher resolution image after the switch in some cases) orwithout a substantial interruption in the presentation of the program.In operation 927, the client device determines a transition point atwhich to switch from content specified by the first media playlist tocontent specified by the second media playlist; an example of atransition point (transition point 959) is shown in FIG. 9D. The contentspecified by the second media playlist is then presented in operation931 after the switch.

The method shown in FIGS. 9C and 9D represents one embodiment fordetermining the transition point; this embodiment relies upon a patternmatching on audio samples from the two streams 951 and 953 to determinethe transition point. It will be appreciated that alternativeembodiments can use pattern matching on video samples or can use thetimestamps in the two streams, etc. to determine the transition point.The method can include, in operation 941, storing content (e.g. stream951) specified by the first media playlist in a buffer; the buffer canbe used for the presentation of the content and also for the patternmatching operation. The stream 951 includes both audio samples 951A andvideo samples 951B. The video samples can use a compression techniquewhich relies on i-frames or key frames which have all necessary contentto display a single video frame. The content in stream 951 can includetimestamps specifying a time (e.g. time elapsed since the beginning ofthe program), and these timestamps can mark the beginning of each of thesamples (e.g. the beginning of each of the audio samples 951A and thebeginning of each of the video samples 951B). In some cases, acomparison of the timestamps between the two streams may not be usefulin determining a transition point because they may not be precise enoughor because of the difference in the boundaries of the samples in the twostreams; however, a comparison of the timestamps ranges can be used toverify there is an overlap 955 in time between the two streams. Inoperation 943, the client device stores in a buffer content specified bythe second media playlist; this content is for the same program as thecontent obtained from the first media playlist and it can includetimestamps also. In one embodiment, timestamps, if not present in astream, can be added to a playlist for a stream; for example, in oneembodiment an ID3 tag which includes one or more timestamps can be addedto an entry in a playlist, such as a variant playlist or a mediaplaylist. The entry may, for example, be in a URI for a first sample ofan audio stream. FIG. 9D shows an example of content 953 obtained fromthe second media playlist, and this includes audio samples 953A andvideo samples 953B. In operation 945, the client device can perform apattern matching on the audio samples in the two streams 951 and 953 toselect from the overlap 955 the transition point 959 which can be, inone embodiment, the next self contained video frame (e.g. i-frame 961)after the matched audio segments (e.g. segments 957). Beginning withi-frame 961 (and its associated audio sample), presentation of theprogram uses the second stream obtained from the second media playlist.The foregoing method can be used in one embodiment for both a changefrom a slower to a faster bit rate and for a change from a faster to aslower bit rate, but in another embodiment the method can be used onlyfor a change from a slower to a faster bit rate and another method (e.g.do not attempt to locate a transition point but attempt to store andpresent content from the slower bit rate stream as soon as possible) canbe used for a change from a faster to a slower bit.

FIG. 10 is a flow diagram of one embodiment of a technique for providingmultiple redundant locations that provide playlists or media content orboth to client devices using alternative streams. If a playlist containsalternate streams as discussed above, then alternate streams can notonly operate as bandwidth or device alternates, but also as failurefallbacks. For example, if the client is unable to reload the playlistfile for a stream (due to a 404 error or a network connection error, forexample), the client can attempt to switch to an alternate stream.Referring to FIG. 10, to implement failover protection, a first serverdevice or first content distribution service is configured to create astream, or multiple alternate bandwidth streams in operation 1002 asdiscussed in conjunction with the description of FIG. 2C. In operation1004, the first server device or first content distribution servicegenerates playlist file(s) from the stream(s) generated in operation1002. A second server device or second content distribution service cancreate a parallel stream, or set of streams, in operation 1006 and alsocreate a playlist. These parallel stream(s) can be considered backupstreams. Next, the list of backup streams is added to the playlistfile(s) in operation 1008 so that the backup stream(s) at each bandwidthis listed after the primary stream. For example, if the primary streamcomes from server ALPHA, and the backup stream is on server BETA, then aplaylist file might be as follows:

  #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000http://ALPHA.mycompany.com/low/prog_index.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000http://BETA.mycompany.com/low/prog_index.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=500000http://ALPHA.mycompany.com/mid/prog_index.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=500000http://BETA.mycompany.com/mid/prog_index.m3u8

Note that the backup streams are intermixed with the primary streams inthe playlist with the backup at each bandwidth is listed after theprimary for that bandwidth. A client is not limited to a single backupstream set. In the example above, ALPHA and BETA could be followed byGAMMA, for instance. Similarly, it is not necessary to provide acomplete parallel set of streams. A single low-bandwidth stream may beprovided on a backup server, for example.

In operation 1010, the client attempts to download playlist file(s) froma first URL using a first stream associated with the first server deviceor the first content distribution service. FIG. 11 illustrates a networkin which a client 1102 communicates bi-directionally with one or moreURLs, server devices or content distribution services, in accordancewith one embodiment. The playlist file(s) may be transmitted from thefirst URL, server device or content distribution service in operation1012 to the client 1102. If a client is unable to download the playlistfile(s) from the first URL, server device, or content distributionservice (e.g., due to an error in reloading the index file for astream), the client attempts to switch to an alternate stream. In theevent of a failure (e.g., index load failure) on one stream (e.g.,operation 1010), the client chooses the highest bandwidth alternatestream that the network connection supports in operation 1014. If thereare multiple alternates at the same bandwidth, the client chooses amongthem in the order listed in the playlist. For example, if the client1102 is not able to successfully download from URL 1, it may downloadfrom URL 2 or another URL in which case the playlist file(s) aretransmitted from the alternative URL to the client. This featureprovides redundant streams that will allow media to reach clients evenin the event of severe local failures, such as a server crashing or acontent distributor node going down.

The failover protection provides the ability to provide multipleredundant locations from which clients can retrieve playlists and mediafiles. Thus, if the client cannot retrieve a stream from a firstlocation, it can attempt to access the stream from a secondary,tertiary, etc. location.

In one embodiment, to indicate the additional locations from which theclient can retrieve a playlist, the same variant playlist tag would beprovided with the same bandwidth, but a new URI of the redundantlocation. The client initially can attempt to access the first URLassociated with the desired bandwidth. If it cannot download theplaylist from the first URL, it then can attempt to access the next URLpresented for the bandwidth, and so on until it has exhausted all thepossibilities.

An example below includes 1 redundant location for the 2560000 bandwidthand 2 redundant locations for the 7680000 bandwidth.

  #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1280000http://example.com/low.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2560000http://example.com/mid.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2560000http://example1.com/mid-redundant2.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=7680000http://example.com/hi.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=7680000http://example2.com/hi-redudant2.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=7680000http://example3.com/hi-redudant3.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=65000,CODECS=“mp4a.40.5”http://example.com/audio-only.m3u8

Note that in this example both the filenames (e.g., mid-redundant2.m3u8)and the actual URL (e.g., http://example2.com <http://example2.com/>,http://example3.com <http://example3.com>) change. However, in oneembodiment, a redundant location can be a change only to the filename oronly to the website.

In one embodiment, a playlist can be compressed by a server device andsent to a client device in a compressed form. The compressed playlistnormally requires fewer bits to represent the playlist than anuncompressed playlist, and hence a compressed playlist uses lessavailable bandwidth of a network, such as a wireless cellular telephonenetwork, when being transmitted or received. In one embodiment, theplaylist can be compressed by a web server according to a built-incompression technique or facility that is used by a web server that iscompliant with or compatible with a transfer protocol such as the HTTP1.1 standard protocol; an example of such a compression technique orfacility is the deflate or the gzip compression facility of HTTP 1.1.Other standards based compression facilities which are part of astandards based transfer protocol can be used in other embodiments. Theuse of compressed playlists can be, in one embodiment, an optionalfeature of server devices and client devices. In one embodiment, theplaylist can be textual content (e.g. a text file) and be compressedefficiently with deflate or gzip by a standards based web server andthen decompressed automatically by a client device. A description of aversion of the gzip compression facility can be found atwww.ietf.org/rfc/rfc1952.txt; a version of the deflate compressionfacility can be found at www.ietf.org/rfc/rfc1951.txt. Many web serversand many web browsers on a client device can automatically support thedeflate or the gzip facilities.

In one embodiment, a client device can periodically request an updatedplaylist; for example, the client device can request, from a server, anupdated playlist every few seconds (e.g. every 10, 20, or 30 seconds orsome other period of time). A growing playlist, such as a playlist for alive on-going baseball game that allows a client to start viewing fromthe beginning of the live game at any time during the live game, canbecome large enough that use of compression can limit the consumption ofa network's bandwidth as the growing playlist is repeatedly sent throughthe network.

In one embodiment, a client device can optionally specify, when itrequests a playlist (such as an updated playlist), what compressiontechniques it can support (such as deflate or gzip); support for thesetechniques means that the client device can decompress or decode thecompressed or encoded content. The client device's request for aplaylist, with the optional specification of a compression technique, isreceived by a web server which, in one embodiment, is not required tosupport a compression technique for a playlist but can send anuncompressed playlist. The web server can respond to the client device'srequest by sending, to the client device, an uncompressed playlist or aplaylist compressed using one of the compression techniques specified inthe client device's request for the playlist. The client device receivesthe playlist and uses it as described herein; if the playlist iscompressed, it is decoded using a decoder on the client device such as adecoder in a web browser on the client device.

FIGS. 12A and 12B show one embodiment of a server timing model for thetransmission of succeeding playlists when additional media files will beadded (e.g., when the current playlist being transmitted does notcontain an EXT-X-ENDLIST tag). If a current playlist does not containthe final media file of a presentation, then a data processing system orserver can make a new version of the playlist that contains at least onenew media file URI. FIGS. 12A and 12B show one embodiment of a servertiming model for ensuring that the new playlist with the new media fileURI will be available for transmission to client devices in a mannercontinuous with the previous version of the playlist. This model may,for example, be used when media files, specified in the playlist, areallowed to be short in duration (e.g. only a few seconds long). In oneembodiment, by setting a maximum media file duration for each media fileand by setting a minimum amount of a playlist duration based upon themaximum media file duration, a server or other data processing systemcan ensure a continuous distribution or transmission of the content toclient devices even when each media file is only a few seconds induration.

Referring now to FIG. 12A, operation 1201 can be used to establish atarget duration as a maximum media file duration of each media file in aplaylist if an endlist tag is not present in a next playlist file asdetermined in operation 1200. Operation 1201 can be performed by a dataprocessing system which is dividing a stream of data into multiple mediafiles and storing those multiple media files as individual files. Theprocess of dividing the stream can utilize the target duration (e.g. thetarget duration of the current playlist file) to ensure that each mediafile specified in the playlist file is less than the target duration (oris less than the target duration plus or minus a small period of time).The data processing system which generates a playlist can also ensurethat the duration of the playlist file can be at least a multiple of thetarget duration as shown in operation 1203. In one embodiment, themultiple can be three target durations (or some other multiple of thetarget duration) which is used as a minimum of a playlist duration,wherein the duration of a playlist is defined by the cumulativedurations of the media files specified within the playlist. A system(e.g. a server) that generates a playlist can comply with the minimumduration of the playlist by ensuring that each playlist specify at leasta sufficient number of media files to satisfy the minimum duration; forexample, if the minimum duration is 3 target durations, then eachplaylist should include at least 3 target durations.

Operation 1205 can also be used as a further mechanism to ensure that aconsistent and continuous stream is made available from a dataprocessing system such as a server which is transmitting the mediafiles. This further mechanism can reduce the amount of polling orpulling, by a client device, to determine whether there are changes tothe playlist. In operation 1205, a server can be set up such that thereis an earliest time and a latest time for the server to transmit thenext playlist file. The earliest time and the latest time can be used asa time window that is based on or relative to the time that the previousplaylist file (which immediately precedes the new playlist file) wasmade available. The earliest time can, for example, be based upon a timewhen an immediately previous playlist was first made available fortransmission (but not necessarily have been transmitted) from theserver. The latest time can, for example, also be based upon a time whenthat immediately previous playlist was first made available fortransmission from the server (but not necessarily have beentransmitted). For example, in one embodiment the earliest time may bespecified as a time that is no earlier than a first predeterminedpercentage (e.g. one-half) of the target duration (e.g. the targetduration set in operation 1201) from when the previous playlist file wasfirst made available for transmission, and the latest time can be set tobe no later than a second predetermined percentage (e.g. one and a halftimes) of the target duration from when the immediately previousplaylist file was first made available for transmission from the server.The time of when the playlist file was first made available fortransmission could be, in one embodiment, the time of creation of theplaylist file (that time being recorded by a file system on the server).This example is shown in FIG. 12B which includes a timeline 1211. Targetduration 1213 is a portion of the playlist duration 1215 whichrepresents the duration of an immediately previous playlist that wasfirst made available by one or more servers at time 1209 which is thetime at which the previous playlist file was first made available fortransmission. The media files specified in that playlist can begin theirtransmission at nearly time 1209. According tog the server timing modelshown in FIG. 12B, a server should not transmit the next playlist fileuntil the earliest time 1217 which is one-half of a target durationafter time 1209, and the server should not make available the nextplaylist file any later than time 1219 which has been specified to beone and a half target durations after time 1209 in the example shown inFIG. 12B. This server timing model can be used to ensure that playlistfiles are made available to client devices to provide the client devicewith enough time to retrieve media files specified in the playlist andto then present those media files consistently and continuously withoutstalls in the presentation of the content during playback. In oneembodiment, these server timing models can be used when the content is atransmission of a live event and a stream of data from the live event isbeing divided into multiple media files and then those multiple mediafiles are transmitted in near real time relative to the live event toclient devices that receive the multiple media files shortly after theywere divided out of the stream of data of the live event, such as abaseball game, etc.

FIG. 13 shows an embodiment of a method which may be used to avoidstalls in playback at a client device, particularly when a client deviceis presenting, in near real-time, a live event and when the clientdevice is presenting content which is near the current end (being themost recent in time) of a live event. For example, if the live event isa baseball game, a user of a client device may prefer to watch only themost recent events in the game rather than beginning to watch the gamefrom the very beginning of the game. If a user desires to watch only themost recent events of a game that is in progress, the user may seek toset playback to start from a point beginning in the last 10 or 15seconds from the end of the available media stream. Problems or delaysin a network can suddenly cause the data to become unavailable and canprevent new data from becoming available, and hence in a very shortperiod of time, the client device can run out of content to present whena user has set a client device to operate in this mode. The method ofFIG. 13 can be employed in order to mitigate the chances of thishappening by enforcing a rule at a client device that playback isrequired to start at a start point which is at least a period of time(for example, 30 seconds) before an end of the current playlist file.For example, if a playlist file has 5 media files specified within it(each media file being 10 seconds long), then one implementation of thisrule may be to enforce a start point to be no later than the third mediafile in the sequence of five media files specified in the playlist.Referring now to FIG. 13, operation 1301 can be used to determinewhether or not an endlist tag or marker is present in the playlist. Ifsuch an endlist tag is present, then the method of FIG. 13 can stop asno new content will be added to the playlist, so there is no need toenforce the rule in operation 1303 in one embodiment. On the other hand,if there is no endlist tag present in the playlist, then a rule can beenforced at a client device which requires a start point to be at leasta period of time before an end of the playlist file. The period of timecan be specified based upon target durations of the media files. Forexample, in one embodiment, the client device can be required to startfrom a media file that is more than three target durations from the endof the playlist file.

Another aspect of the present invention relates to methods which can beused when switching between streams from two playlists (e.g. two variantstreams) or other switching between two sets of media files. An exampleof a method for switching between streams from two different playlistshas been provided in conjunction with FIGS. 9A, 9B, 9C, and 9D. In thatmethod, an overlap in time between the two streams can be used to ensurea consistent and continuous playback such that a switch or transitionbetween the streams can be seamless. As shown in FIG. 9D, the overlap955 represents a period in time in which media content from both streamsis stored at a client device and capable of being played back at theclient device, thereby allowing a seamless switch between the twostreams. In one embodiment, the overlap may be a minimum number whichnever varies and is set within the client device. While this embodimentcan work well, there can be times when the overlap can be unnecessarilytoo long. In other words, the overlap can prevent a switch or transitionfrom occurring even though a device is ready to make the transition. Forexample, when switching from a lower resolution to a higher resolution,an unnecessarily long overlap can force the user to watch the lowerresolution presentation for a period of time when the higher resolutionpresentation is already available and ready to be presented. Higherspeed connections can, for example, provide the ability to quicklydevelop an overlap which can be shorter than an overlap required for alower speed connection or type of connection. In an embodiment accordingto FIG. 14A, a client device can adapt to the connection speed orconnection type and modify the minimum overlap required based upon theconnection speed or connection type. For example, if the connectionspeed or type is fast then the minimum overlap can be reduced relativeto a minimum overlap required for a lower connection speed or connectiontype. As conditions change (e.g. the client device loses a 3G connectionand must rely upon a 2G or slower connection), then the minimum overlapcan be changed. Hence, the client device can adapt the minimum overlapbased upon the connection speed or type. Referring now to FIG. 14A, inoperation 1401, a client device can determine a speed of or type ofconnection. Referring back to FIG. 9D, it can be seen that a secondstream of data from a second playlist is a new source of data which isbeing received while the client device also receives the stream from afirst playlist. At this time, the client device can determine a speed ofconnection or a type of connection in order to determine, in operation1403, a minimum amount of overlap required based upon the currentconnection speed or connection type. As conditions change, this minimumoverlap can be adapted based upon the changing conditions, such aswireless connections to cellular telephone towers, WiFi basestations,etc. This may be particularly advantageous when the client device ismoving through a wireless cellular telephone network or other datanetwork. After establishing that the minimum overlap for the currentcondition exists, then the client device can, in operation 1405, switchor transition from the stream from the first playlist or the old sourceto the new source which may be the stream from the second playlist. Anexample of this transition has been provided in connection with thedescription associated with FIGS. 9A-9D.

FIGS. 14B, 14C, and 14D show another aspect of how an overlap betweentwo streams (such as the overlap described and shown in conjunction withFIGS. 9A-9D or the overlap described in conjunction with FIG. 14A). Themethod shown in FIGS. 14B, 14C and 14D may be implemented with anadaptively derived overlap (which was described in conjunction with FIG.14A) or this method may be used with a fixed overlap which does notchange. The method depicted in FIGS. 14B-14D can begin with thedownloading of media files from the “old stream” 1410 (e.g. which can bea lower resolution video downloaded at a first speed which is slower inbit rate than a second speed of future downloads for the new stream1414). The old stream 1410 has been downloaded as indicated by the hashmarker 1411 and it is currently being presented, on a client device, toa user at playback point (e.g. playback head position at) 1412; thealready downloaded content in old stream 1410 beyond the currentplayback point 1412 is buffered content that is available should theconnection become faulty. The client device can then read a playlistfile for the new stream 1414 and determine from the playlist file thecontent “blocks,” such as blocks 1416 and 1415, before even downloadingthe content of those blocks; for example, the playlist file for the newstream can indicate, at least approximately, the locations in time ofthe content blocks 1416 and 1415 relative to old stream 1410. Thisdetermination can allow the client device to conservatively decide todownload first block 1415 for the new stream 1414 by requesting andretrieving one or more media files for block 1415, and FIG. 14C showsthe result of that download (block 1415A has hash marks to show thatthis block has been downloaded). The playback position has progressed intime to a new location (still within the leftmost block of old stream1410). In this instance the downloading of block 1415 was fast enoughthat the playback position did not leave that leftmost block of oldstream 1410. Block 1415 was selected conservatively in case the downloadtook longer so that playback could at least be switched around block1415A. At the point depicted in FIG. 14C, the client device can checkhow much time is left between the overlap provided by block 1415A andthe current point of playback (shown by 1412 in FIG. 14C). If there isenough time given the connection speed, the client device can downloadthe block or segment 1416 which is the block previous to the currentoverlap, and then the client device can repeat the check to determinehow much time is left between the overlap provided by just downloadedblock 1416A (shown in FIG. 14D after it has been downloaded as indicatedby the hash marks) and the current point of playback (shown by 1412 inFIG. 14D). If, as in the case of the example shown in FIG. 14D, thedownload of 1416A happens quickly, then the client device can move thepoint of overlap backward in time, reducing the time it will take toswitch between the streams (and hence allowing a switch within block1416A); on the other hand, if there are delays in downloading 1416A suchthat the switch cannot occur within block 1416A, then the client devicecan use block 1415A as an overlap that could be used to cause the switchto occur within block 1415A.

Another aspect of the present invention can utilize an attributedefining a resolution of images. This attribute can allow a clientdevice to decide that it should not switch resolutions or otherwiseswitch streams based upon the attribute. For example, a client devicecan decide that it is already playing the maximum resolution which itcan display and that there is no point in downloading a higherresolution which may be available to the device through a data network.

FIG. 15 shows an example of a method in one embodiment for utilizingsuch an attribute. In operation 1501, a playlist file can be received bya client device, and the client device, in operation 1503, can determinefrom the playlist file that an attribute exists within the playlist filewhich defines the resolution of images available to the client device.Based upon that attribute, the client device can, in operation 1505,determine whether to retrieve another playlist file or to retrieve amedia file associated with that attribute. By providing the resolutionattribute, a client device can intelligently decide how to process thedata in the playlist. Moreover, the client device can make decisionsabout the retrieval of data which can prevent unnecessary downloads, andthis can, in turn, minimize the amount of data traffic on the network.

An embodiment of the invention can allow a system to search for contentbased upon a date and time. For example, a user may want to see a homerun hit on Apr. 9, 2009 at about 5 PM or may want to see another eventon a date and approximate time. An embodiment of the invention canprovide this capability by timestamping, through the use of anEXT-X-PROGRAM-DATE-TIME tag that is associated with the beginning of acorresponding media file; the tag can be associated with itscorresponding media file by having the tag appear before that media filein a playlist file. A system, such as a server, can store one or moreplaylists which can be retrieved (e.g., downloaded) by a client deviceand used to search for a date and time to find a desired media file;alternatively, a client device can request (e.g., through a date andtime search request) the server to search through the one or moreplaylists to identify one or more media files that match the date andtime search request, and the server can respond by identifying the oneor more media files. In one embodiment, the tag indicates asubstantially precise beginning of the media files, and timestampswithin the media file can be used to find a playback point with finergranularity in time. For example, a tag's timestamp can indicate themedia file began on Apr. 9, 2009 at 5:03 PM, and the timestamps (orother indicators of time) within a media file can specify time inincrements of minutes or seconds, etc. after 5:03 PM to allow a deviceto begin playback (through a selection of a playback start point) at,for example, 5:06 PM or 5:05:30 PM.

FIG. 16A shows a flowchart that depicts a method according to oneembodiment for using the timestamped tags to create a playlist file. Themethod can be performed by a server implemented with processing logicincluding software, hardware, firmware, or a combination of any of theabove. In some examples, the server is provided by a media provider,such as MLB.

At box 1610, processing logic creates timestamped tags and associateseach of the timestamped tags with one media file. The timestamp in atimestamped tag indicates a beginning date and time of the associatedmedia file. Details of some embodiments of timestamped tags have beendiscussed above.

At box 1620, processing logic creates a playlist file with one or moretimestamped tags (e.g., EXT-X-PROGRAM-DATE-TIME tag), each of which isassociated with a particular media file. Note that the media file itselfhas internal timestamps as well. At box 1630, processing logic maydistribute the playlist so that the playlist file is available forsearching by date and time using the date and time in the timestampedtags. In some embodiments, the playlist is stored in a repository, fromwhich client devices may download the playlist.

FIG. 16B shows a flowchart that depicts a method according to oneembodiment for using a playlist file created with the timestamped tags.The method can be performed by a client device implemented withprocessing logic including software, hardware, firmware, or acombination of any of the above. The client device may be used byindividual consumers, subscribers, or viewers of the media associatedwith the playlist file to access and play the media.

At box 1650, processing logic receives a user request for a segment of aprogram beginning at a particular date and time. For example, the usermay request a fourth inning of a baseball game that begins at 8:15 pm onApr. 6, 2010, instead of the entire baseball game. In response to theuser request, processing logic downloads one or more playlist filesassociated with the program from a media server at block 1652. At block1654, processing logic searches the playlist files downloaded using thedate and time in the timestamp tags inside the playlist files for thedate and time stamps closest to the date and time of the segmentrequested. Then processing logic subtracts its date and time from thedate and time of the segment requested at block 1656. This produces aduration. Processing logic then walks forward through the subsequentmedia file durations in the playlist file until processing logic locatesa target media file about that much duration after the datestamped mediafile at block 1657. Processing logic then downloads this target mediafile at block 1658, as it is the best guess about which file containsthe requested segment.

In some embodiments, all media files between the datestamped one and thetarget one are part of a single encoding, that is, no discontinuity tagin between them. If they are, processing logic can subtract media filetimestamps in the datestamped file from those in the target file to getprecise durations, which allows the location of the requested date andtime precisely.

Using the dates and times in the timestamped tags in the playlist files,processing logic does not have to download all media files of the entireprogram in order to search through the media files to find the requestedsegment. Because the client device does not have to download all mediafiles of the entire program when the user does not request the entireprogram, significant savings in bandwidth can be achieved. Furthermore,many typical media files contain only arbitrary timestamps, which oftenstart at zero. Thus, the dates and times of the timestamped tagsdiscussed above may associate the arbitrary timestamps in the mediafiles with a real date and/or time. Using the timestamped tags, theclient device can locate the playlist element containing a particulardate and/or time more efficiently than scanning through each media file.

One embodiment of the invention allows insertion of timed metadata intoa media stream in an ID3 format. The media stream may include videoand/or audio data encoded in a predetermined format. For example, themedia stream may include video and audio data encoded in MPEG-2developed by the Moving Pictures Expert Group (MPEG), which isinternational standard ISO/IEC 13818. Broadly speaking, metadataincludes information on data in the media stream, and timed metadatareferred to metadata associated with a particular time (e.g., the timeat which a goal was scored). Note that timed metadata may change overtime. The timed metadata may be inserted into the media stream in apredetermined format for storing metadata, such as ID3 format. In someembodiments, the video data may be divided into a sequence of frames.Timed metadata of the video data may also be divided into containersassociated with the sequence of frames. Each container may store bothtimed metadata of a corresponding frame and the time associated with thecorresponding frame. Alternatively, each container may store both timedmetadata of a corresponding frame and frame number of the correspondingframe. In some embodiments, the timed metadata of a frame may include aset of predetermined information of the frame. For example, the timedmetadata may include location information (e.g., global positioningsystem (GPS) data) of the location at which the corresponding frame ofvideo data was recorded.

FIGS. 16C, 16D, and 16E show an example of an embodiment which can usetimed metadata or other mechanisms to control playback of streamingcontent that has been buffered at a receiver, such as a client devicethat has requested the streaming content by sending URL(s) which specifythe streaming content. These URLs can be contained in one or moreplaylist files as described herein.

FIG. 16C shows a user interface (UI) that can be presented on displaydevice 1660 (or on a portion of that display device). A content 1661,such as a live sports event or show or other animated content that istime based, is presented along with, in one embodiment, two time lines1662 and 1666. Time line 1666 shows the entire length, in time, of thecontent (which can be either a fixed amount of time, such as a 90-minuteshow, or an indefinite amount of time, such as a baseball game). Anindicator 1667 can be presented to show a current playback positionwithin the entire content; the position of indicator 1667 on the timeline 1666 relative to the length of the time line indicates that currentplayback position. For example, if indicator 1667 is halfway between theleft endpoint and the right endpoint, then the current playback positionis about halfway through the existing content. Time line 1666 can alsobe associated with other UI controls such as go back control 1668, pausecontrol 1669, and fast forward control 1670. The go back control 1668can, when selected, move the current playback position back in time(e.g. move back 30 seconds). The pause control 1669 can, when selected,stop playback at the receiver, and fast forward control 1670 can, whenselected, cause the current playback position to move to the most recentcurrent (e.g. live or near live) content. In one embodiment, both timelines 1666 and 1662 can be concurrently present in a translucent orsemi-transparent panel which overlays the streaming content beingpresented under the panels.

Time line 1662 represents, in one embodiment, a length in time of anamount of buffered content at the receiver. The receiver can buffer thestreaming content, as described herein, to assure that there is alwayssome streaming content to playback even if data communication ratesbecome slower or data communication of the streaming content isinterrupted. In the example shown in FIG. 16C, 4 minutes and 30 seconds,in total, of streaming content has been received and buffered at thereceiver; this total time is derived from marker 1663 (3 minutes, 51seconds) and marker 1665 (39 seconds), and these markers also show thatthe current playback position is 39 seconds from the most recentlyreceived content (which could be live or near real time live asdescribed herein). In one embodiment, the current playback positionwithin the buffered content can be changed by, for example, selectingand moving indicator 1664 along time line 1662. This can be done, forexample, by touching the indicator 1662 with a finger or by control of acursor through a mouse, or through other known user interfacetechniques. FIG. 16D shows an example of the result of moving indicator1662 (to the halfway point in the buffered content) so that thepresentation of the content is currently set at a playback point that is2 minutes and 15 seconds before the most currently received and bufferedcontent (which is represented by the right endpoint of the time line).

FIG. 16E shows an example of a method of one embodiment for using theuser interface shown in FIGS. 16C and 16D. A data processing system,such as a receiver, can in operation 1672 display or otherwise present atime line, such as time line 1666, which represents a current length ofa streaming program and can also display UI controls, such as controls1668, 1669, and 1670. In addition, this system can also, in operation1673, concurrently display another time line, such as time line 1662,that indicates a current playback position within the buffered content.In one embodiment, the time line can show an indicator of the currentplayback position in the buffered content on a time line that canrepresent the total length in time of the currently buffered content.The receiver can respond, in operation 1674, to user inputs on the oneor more UI controls in order to change the presentation of the streamingcontent. For example, if the user moves indicator 1664 along time line1662, the user can change the current playback position within thebuffered content; the example shown in FIGS. 16C and 16D shows that thecurrent playback position can be changed from several seconds before themost recently received content (which could be a near real time “live”stream) to several minutes before the most recent content. In theexample of FIGS. 16C and 16D, the user has, in effect, rewound theplayback to an earlier point within the buffered content and can replaythe buffered content, and this rewinding can be controlled on a timeline that is separate from the entire current time line, such as timeline 1666, of the content.

In one embodiment of the invention, processing of media files (e.g.,retrieved of playlists and retrieved of media files specified in theplaylist and decoding of the content in the media files) can be doneseparately, from a user interface that presents and controls the mediafrom being presented. For example, a user application, such as anapplication for watching live events (e.g., as Major League Baseball(MLB) application for watching baseball games) or other streams canprovide the user interface for presenting and controlling (e.g.,receiving a selection of a media file) the presentation while anothersoftware process (e.g., a software process that serves media such as adaemon for serving media, which can be referred to as “mediaserverd”)can retrieve playlists and retrieve and decode media files. In somecases, the media files can be encrypted, and the encryption can becontrolled by the user application (e.g., the MLB application); forexample, a user application can install a client certificate (forexample, an X.509 certificate to provide authentication and chain oftrust, and revocability) into their keychain (either persistently or inmemory only) that can be used to answer a server challenge when an HTTPSecured Sockets Layer (SSL) connection is made to download a key thatcan be used to decrypt the media's content. In other cases, a playlistcan contain URLs for one or more keys that use a custom URL scheme thatis used by the user application or a server that interacts with the userapplication; in this case, a user application can register URL protocolhandlers for these custom URL schemes that can be invoked to obtain akey (such as a new key), and this can allow a user application totransport keys out of band (e.g., hidden in their application binary),or obtain a key from a server using a private protocol.

FIG. 17 shows one embodiment of software architecture to allow a mediaserving daemon to interact with a user application. The architectureincludes a media serving daemon (“mediaserverd”) 1710 and an exemplaryuser application, Event Media Provider (EMP) application 1720, bothexecutable in processes running on a client device, such as, forexample, a smart phone, a personal digital assistant, a desktopcomputer, a laptop computer, a tablet device, etc. One embodiment of theclient device may be implemented using electronic system 800 shown inFIG. 8. In some embodiments, both mediaserverd 1710 and EMP application1720 share the same privileges with respect to memory control, memoryspace, memory allocation, filesystem control, and network control. Assuch, mediaserverd 1710 may access data that EMP application 1720 canaccess. Likewise, mediaserverd 1710 is prohibited from accessing datathat EMP application 1720 cannot access.

In some embodiments, EMP application 1720 further includes a core mediastack 1721, which is a customized software stack for accessing anetworking stack 1723, which in turns accesses an URL protocol handler,EMP handler 1725. EMP application 1720 can register EMP handler 1725 fora custom URL scheme that can be invoked to obtain one or more keys.Thus, EMP application 1720 can transport keys out of band (e.g., hiddenin the application binary).

In general, mediaserverd 1710 and EMP application 1720 can interact witheach other to download and playback media files for live streamingcontent from a content provider, which is EMP in the current example.Playback can be done in mediaserverd 1710 on the client device. In someembodiments, mediaserverd 1710 can download keys for decryption of mediafiles, and if this fails, mediaserverd 1710 may ask EMP application 1720to download the key from a content provider server, which is EMP server1730 in the current example. EMP application 1720 running on the clientdevice can sign up to get one or more keys. Usually, EMP application1720 may have signed up and obtained the keys prior to downloading themedia files. Details of some embodiments of the interactions betweenmediaserverd 1710 and EMP application 1720 are discussed below tofurther illustrate the concept.

Referring to FIG. 17, EMP application 1720 sends a playlist with atleast an URL and a key to mediaserverd 1710 (1). Using the key,mediaserverd 1710 attempts to access a media source provided by EMP atthe URL and to download media files specified in the playlist from themedia source. The media files may be encoded or encrypted to preventunauthorized viewing of the content of the media files. If mediaserverd1710 fails to download the media files, or it fails to decode or decryptthe media files downloaded (2), mediaserverd 1710 reports the failure toEMP application 1720 (3).

In response to the failure report from mediaserverd 1710, EMPapplication 1720 uses fits core media stack 1721 to access networkingstack 1723 in order to request a new key (4), which in turns accessesEMP handler 1725 for the new key (5). EMP handler 1725 connects to EMPserver 1730 over a network (e.g., Internet) to request the new key fromEMP server 1730 (6). In response to the request, EMP server 1730 sendsthe new key to EMP handler (7). Then EMP handler 1725 passes the new keyto core media stack 1721 (8), which then passes the new key tomediaserverd 1710 (9).

When mediaserverd 1710 receives the new key from core media stack 1721,mediaserverd 1710 may try to download the media files again using thenew key and then decode the media files downloaded using the new key(10). Alternatively, if the media files were successfully downloadedpreviously, but mediaserverd 1710 failed to decrypt the media files,then mediaserverd 1710 may try to decrypt the media files previouslydownloaded using the new key. If mediaserverd 1710 successfullydownloads and decodes the media files using the new key, then EMPapplication 1720 may present the decoded media files on the clientdevice.

FIG. 8 is a block diagram of one embodiment of an electronic system. Theelectronic system illustrated in FIG. 8 is intended to represent a rangeof electronic systems (either wired or wireless) including, for example,desktop computer systems, laptop computer systems, cellular telephones,personal digital assistants (PDAs) including cellular-enabled PDAs, settop boxes, entertainment systems or other consumer electronic devices.Alternative electronic systems may include more, fewer and/or differentcomponents. The electronic system of FIG. 8 may be used to provide theclient device and/or the server device.

Electronic system 800 includes bus 805 or other communication device tocommunicate information, and processor 810 coupled to bus 805 that mayprocess information. While electronic system 800 is illustrated with asingle processor, electronic system 800 may include multiple processorsand/or co-processors. Electronic system 800 further may include randomaccess memory (RAM) or other dynamic storage device 820 (referred to asmain memory), coupled to bus 805 and may store information andinstructions that may be executed by processor 810. Main memory 820 mayalso be used to store temporary variables or other intermediateinformation during execution of instructions by processor 810.

Electronic system 800 may also include read only memory (ROM) and/orother static storage device 830 coupled to bus 805 that may store staticinformation and instructions for processor 810. Data storage device 840may be coupled to bus 805 to store information and instructions. Datastorage device 840 such as flash memory or a magnetic disk or opticaldisc and corresponding drive may be coupled to electronic system 800.

Electronic system 800 may also be coupled via bus 805 to display device850, such as a cathode ray tube (CRT) or liquid crystal display (LCD),to display information to a user. Electronic system 800 can also includean alphanumeric input device 860, including alphanumeric and other keys,which may be coupled to bus 805 to communicate information and commandselections to processor 810. Another type of user input device is cursorcontrol 870, such as a touchpad, a mouse, a trackball, or cursordirection keys to communicate direction information and commandselections to processor 810 and to control cursor movement on display850.

Electronic system 800 further may include one or more networkinterface(s) 880 to provide access to a network, such as a local areanetwork. Network interface(s) 880 may include, for example, a wirelessnetwork interface having antenna 885, which may represent one or moreantenna(e). Electronic system 800 can include multiple wireless networkinterfaces such as a combination of WiFi, Bluetooth and cellulartelephony interfaces. Network interface(s) 880 may also include, forexample, a wired network interface to communicate with remote devicesvia network cable 887, which may be, for example, an Ethernet cable, acoaxial cable, a fiber optic cable, a serial cable, or a parallel cable.

In one embodiment, network interface(s) 880 may provide access to alocal area network, for example, by conforming to IEEE 802.11b and/orIEEE 802.11g standards, and/or the wireless network interface mayprovide access to a personal area network, for example, by conforming toBluetooth standards. Other wireless network interfaces and/or protocolscan also be supported.

In addition to, or instead of, communication via wireless LAN standards,network interface(s) 880 may provide wireless communications using, forexample, Time Division, Multiple Access (TDMA) protocols, Global Systemfor Mobile Communications (GSM) protocols, Code Division, MultipleAccess (CDMA) protocols, and/or any other type of wirelesscommunications protocol.

One or more Application Programming Interfaces (APIs) may be used insome embodiments. An API is an interface implemented by a program codecomponent or hardware component (hereinafter “API-implementingcomponent”) that allows a different program code component or hardwarecomponent (hereinafter “API-calling component”) to access and use one ormore functions, methods, procedures, data structures, classes, and/orother services provided by the API-implementing component. An API candefine one or more parameters that are passed between the API-callingcomponent and the API-implementing component.

An API allows a developer of an API-calling component (which may be athird party developer) to leverage specified features provided by anAPI-implementing component. There may be one API-calling component orthere may be more than one such component. An API can be a source codeinterface that a computer system or program library provides in order tosupport requests for services from an application. An operating system(OS) can have multiple APIs to allow applications running on the OS tocall one or more of those APIs, and a service (such as a programlibrary) can have multiple APIs to allow an application that uses theservice to call one or more of those APIs. An API can be specified interms of a programming language that can be interpreted or compiled whenan application is built.

In some embodiments the API-implementing component may provide more thanone API, each providing a different view of or with different aspectsthat access different aspects of the functionality implemented by theAPI-implementing component. For example, one API of an API-implementingcomponent can provide a first set of functions and can be exposed tothird party developers, and another API of the API-implementingcomponent can be hidden (not exposed) and provide a subset of the firstset of functions and also provide another set of functions, such astesting or debugging functions which are not in the first set offunctions. In other embodiments the API-implementing component mayitself call one or more other components via an underlying API and thusbe both an API-calling component and an API-implementing component.

An API defines the language and parameters that API-calling componentsuse when accessing and using specified features of the API-implementingcomponent. For example, an API-calling component accesses the specifiedfeatures of the API-implementing component through one or more API callsor invocations (embodied for example by function or method calls)exposed by the API and passes data and control information usingparameters via the API calls or invocations. The API-implementingcomponent may return a value through the API in response to an API callfrom an API-calling component. While the API defines the syntax andresult of an API call (e.g., how to invoke the API call and what the APIcall does), the API may not reveal how the API call accomplishes thefunction specified by the API call. Various API calls are transferredvia the one or more application programming interfaces between thecalling (API-calling component) and an API-implementing component.Transferring the API calls may include issuing, initiating, invoking,calling, receiving, returning, or responding to the function calls ormessages; in other words, transferring can describe actions by either ofthe API-calling component or the API-implementing component. Thefunction calls or other invocations of the API may send or receive oneor more parameters through a parameter list or other structure. Aparameter can be a constant, key, data structure, object, object class,variable, data type, pointer, array, list or a pointer to a function ormethod or another way to reference a data or other item to be passed viathe API.

Furthermore, data types or classes may be provided by the API andimplemented by the API-implementing component. Thus, the API-callingcomponent may declare variables, use pointers to, use or instantiateconstant values of such types or classes by using definitions providedin the API.

Generally, an API can be used to access a service or data provided bythe API-implementing component or to initiate performance of anoperation or computation provided by the API-implementing component. Byway of example, the API-implementing component and the API-callingcomponent may each be any one of an operating system, a library, adevice driver, an API, an application program, or other module (itshould be understood that the API-implementing component and theAPI-calling component may be the same or different type of module fromeach other). API-implementing components may in some cases be embodiedat least in part in firmware, microcode, or other hardware logic. Insome embodiments, an API may allow a client program to use the servicesprovided by a Software Development Kit (SDK) library. In otherembodiments an application or other client program may use an APIprovided by an Application Framework. In these embodiments theapplication or client program may incorporate calls to functions ormethods provided by the SDK and provided by the API or use data types orobjects defined in the SDK and provided by the API. An ApplicationFramework may in these embodiments provide a main event loop for aprogram that responds to various events defined by the Framework. TheAPI allows the application to specify the events and the responses tothe events using the Application Framework. In some implementations, anAPI call can report to an application the capabilities or state of ahardware device, including those related to aspects such as inputcapabilities and state, output capabilities and state, processingcapability, power state, storage capacity and state, communicationscapability, etc., and the API may be implemented in part by firmware,microcode, or other low level logic that executes in part on thehardware component.

The API-calling component may be a local component (i.e., on the samedata processing system as the API-implementing component) or a remotecomponent (i.e., on a different data processing system from theAPI-implementing component) that communicates with the API-implementingcomponent through the API over a network. It should be understood thatan API-implementing component may also act as an API-calling component(i.e., it may make API calls to an API exposed by a differentAPI-implementing component) and an API-calling component may also act asan API-implementing component by implementing an API that is exposed toa different API-calling component.

The API may allow multiple API-calling components written in differentprogramming languages to communicate with the API-implementing component(thus the API may include features for translating calls and returnsbetween the API-implementing component and the API-calling component);however the API may be implemented in terms of a specific programminglanguage. An API-calling component can, in one embedment, call APIs fromdifferent providers such as a set of APIs from an OS provider andanother set of APIs from a plug-in provider and another set of APIs fromanother provider (e.g. the provider of a software library) or creator ofthe another set of APIs.

FIG. 18 is a block diagram illustrating an exemplary API architecture,which may be used in some embodiments of the invention. As shown in FIG.18, the API architecture 1800 includes the API-implementing component1810 (e.g., an operating system, a library, a device driver, an API, anapplication program, software or other module) that implements the API1820. The API 1820 specifies one or more functions, methods, classes,objects, protocols, data structures, formats and/or other features ofthe API-implementing component that may be used by the API-callingcomponent 1830. The API 1820 can specify at least one calling conventionthat specifies how a function in the API-implementing component receivesparameters from the API-calling component and how the function returns aresult to the API-calling component. The API-calling component 1830(e.g., an operating system, a library, a device driver, an API, anapplication program, software or other module), makes API calls throughthe API 1820 to access and use the features of the API-implementingcomponent 1810 that are specified by the API 1820. The API-implementingcomponent 1810 may return a value through the API 1820 to theAPI-calling component 1830 in response to an API call.

It will be appreciated that the API-implementing component 1810 mayinclude additional functions, methods, classes, data structures, and/orother features that are not specified through the API 1820 and are notavailable to the API-calling component 1830. It should be understoodthat the API-calling component 1830 may be on the same system as theAPI-implementing component 1810 or may be located remotely and accessesthe API-implementing component 1810 using the API 1820 over a network.While FIG. 18 illustrates a single API-calling component 1830interacting with the API 1820, it should be understood that otherAPI-calling components, which may be written in different languages (orthe same language) than the API-calling component 1830, may use the API1820.

The API-implementing component 1810, the API 1820, and the API-callingcomponent 1830 may be stored in a machine-readable non-transitorystorage medium, which includes any mechanism for storing information ina form readable by a machine (e.g., a computer or other data processingsystem). For example, a machine-readable medium includes magnetic disks,optical disks, random access memory; read only memory, flash memorydevices, etc.

In FIG. 19 (“Software Stack”), an exemplary embodiment, applications canmake calls to Services 1 or 2 using several Service APIs and toOperating System (OS) using several OS APIs. Services 1 and 2 can makecalls to OS using several OS APIs.

Note that the Service 2 has two APIs, one of which (Service 2 API 1)receives calls from and returns values to Application 1 and the other(Service 2 API 2) receives calls from and returns values to Application2. Service 1 (which can be, for example, a software library) makes callsto and receives returned values from OS API 1, and Service 2 (which canbe, for example, a software library) makes calls to and receivesreturned values from both OS API 1 and OS API 2. Application 2 makescalls to and receives returned values from OS API 2.

Reference in the specification to “one embodiment” or “an embodiment”means that a particular feature, structure, or characteristic describedin connection with the embodiment is included in at least one embodimentof the invention. The appearances of the phrase “in one embodiment” invarious places in the specification are not necessarily all referring tothe same embodiment.

In the foregoing specification, the invention has been described withreference to specific embodiments thereof. It will, however, be evidentthat various modifications and changes can be made thereto withoutdeparting from the broader spirit and scope of the invention. Thespecification and drawings are, accordingly, to be regarded in anillustrative rather than a restrictive sense.

What is claimed is:
 1. A machine readable, tangible, non-transitorystorage medium storing executable instructions that when executed by adata processing system cause the system to perform a method comprising:presenting a first time line representing a length of a streamingprogram retrieved through one or more URLs in a playlist file andpresenting at least one user interface control for controlling thestreaming program, wherein the at least one user interface control isone of (a) a back control; (b) a pause control; or (c) a fast forwardcontrol; presenting a second time line representing a length, in time,of an amount of buffered content at the data processing system andpresenting an indicator which shows a current playback position withinthe buffered content, wherein the indicator is selectable by a user tochange the current playback position within the buffered content, andwherein the first time line and the second time line are presentedconcurrently by displaying both time lines simultaneously; retrievingthe streaming program by transmitting requests using the one or moreURLs in the playlist file; and presenting the streaming program whilepresenting the first time line translucently overlaid on the streamingprogram and the second time line translucently overlaid on the streamingprogram.
 2. The medium as in claim 1 wherein the indicator is draggablealong the second time line.
 3. The medium as in claim 1 wherein thefirst time line comprises a position indicator displayed on the firsttime line, wherein the position indicator indicates a current playbackposition within the entire existing content of the streaming program. 4.The medium as in claim 3 wherein the method further comprises:displaying a first time marker at a first end of the second time line,wherein the first time marker shows a time duration of the bufferedcontent which currently exists before the current playback positionwithin the buffered content; and displaying a second time marker at asecond end of the second time line, wherein the second time marker showsa time duration of the buffered content which currently exists after thecurrent playback position within the buffered content.
 5. The medium asin claim 4 wherein the first time marker and the second time markerchange when the indicator is moved along the second time line.
 6. Amethod executed by a data processing system, the data processing systemcomprising a processor, a network interface and a memory configured toreceive a length of a streaming program retrieved through one or moreURLs in a playlist file, and a memory comprising processor-executableinstructions for executing the method, the method comprising: presentinga first time line representing a length of a streaming program retrievedthrough one or more URLs in a playlist file and presenting at least oneuser interface control for controlling the streaming program, whereinthe at least one user interface control is one of (a) a back control;(b) a pause control; or (c) a fast forward control; presenting a secondtime line representing a length, in time, of an amount of bufferedcontent at the data processing system and presenting an indicator whichshows a current playback position within the buffered content, whereinthe indicator is selectable by a user to change the current playbackposition within the buffered content, the indicator is draggable alongthe second time line, the first time line and the second time line arepresented concurrently by displaying both time lines simultaneously;retrieving the streaming program by transmitting requests using the oneor more URLs in the playlist file; and presenting the streaming programwhile presenting the first time line translucently overlaid on thestreaming program and the second time line translucently overlaid on thestreaming program.
 7. The method as in claim 6 wherein the indicator isdraggable along the second timeline.
 8. The method as in claim 6 whereinthe first time line comprises a position indicator displayed on thefirst time line, wherein the position indicator indicates a currentplayback position within the entire existing content of the streamingprogram.
 9. The method as in claim 8 wherein the method furthercomprises: displaying a first time marker at a first end of the secondtime line, wherein the first time marker shows a time duration of thebuffered content which currently exists before the current playbackposition within the buffered content; and displaying a second timemarker at a second end of the second time line, wherein the second timemarker shows a time duration of the buffered content which currentlyexists after the current playback position within the buffered content.10. The method as in claim 9 wherein the first time marker and thesecond time marker change when the indicator is moved along the secondtime line.
 11. A data processing system comprising: means for presentinga first time line representing a length of a streaming program retrievedthrough one or more URLs in a playlist file and presenting at least oneuser interface control for controlling the streaming program, whereinthe at least one user interface control is one of (a) a back control;(b) a pause control; or (c) a fast forward control; means for presentinga second time line representing a length, in time, of an amount ofbuffered content at the data processing system and presenting anindicator which shows a current playback position within the bufferedcontent, wherein the indicator is selectable by a user to change thecurrent playback position within the buffered content, wherein the firsttime line and the second time line are presented concurrently bydisplaying both time lines simultaneously; means for retrieving thestreaming program by transmitting requests using the one or more URLs inthe playlist file; and means for presenting the streaming program whilepresenting the first time line translucently overlaid on the streamingprogram and the second time line translucently overlaid on the streamingprogram.
 12. The system as in claim 11 wherein the indicator isdraggable along the second time line.
 13. The system as in claim 11wherein the first time line comprises a position indicator displayed onthe first time line, wherein the position indicator indicates a currentplayback position within the entire existing content of the streamingprogram.
 14. The medium as in claim 13 wherein the system furthercomprises: means for displaying a first time marker at a first end ofthe second time line, wherein the first time marker shows a timeduration of the buffered content which currently exists before thecurrent playback position within the buffered content; and means fordisplaying a second time marker at a second end of the second time line,wherein the second time marker shows a time duration of the bufferedcontent which currently exists after the current playback positionwithin the buffered content and wherein the first time marker and thesecond time marker change when the indicator is moved along the secondtime line.